X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-add--interactive.perl;h=da768ee7acc22e6480f0a067e109239561d43927;hb=d36f8679e94c2a0d4d15d6adcea434634af6d627;hp=801d7c02513be636ac682b503de7b9b4121acee9;hpb=633ce9a3ba973acf19a122e1359b7ae724887d70;p=git.git diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 801d7c025..da768ee7a 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -54,7 +54,7 @@ sub colored { my $patch_mode; sub run_cmd_pipe { - if ($^O eq 'MSWin32') { + if ($^O eq 'MSWin32' || $^O eq 'msys') { my @invalid = grep {m/[":*]/} @_; die "$^O does not support: @invalid\n" if @invalid; my @args = map { m/ /o ? "\"$_\"": $_ } @_; @@ -406,9 +406,9 @@ sub list_and_choose { if ($choice =~ s/^-//) { $choose = 0; } - # A range can be specified like 5-7 - if ($choice =~ /^(\d+)-(\d+)$/) { - ($bottom, $top) = ($1, $2); + # A range can be specified like 5-7 or 5-. + if ($choice =~ /^(\d+)-(\d*)$/) { + ($bottom, $top) = ($1, length($2) ? $2 : 1 + @stuff); } elsif ($choice =~ /^\d+$/) { $bottom = $top = $choice;