]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-add--interactive.perl
shortlog: support --pretty=format: option
[git.git] / git-add--interactive.perl
index 801d7c02513be636ac682b503de7b9b4121acee9..a6a5c52b59b893d6f69fce483c82c762a089003d 100755 (executable)
@@ -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;