Make "git-log --" without paths behave the same as "git-log" without --
authorJunio C Hamano <gitster@pobox.com>
Fri, 31 Aug 2007 05:58:26 +0000 (22:58 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 31 Aug 2007 07:26:41 +0000 (00:26 -0700)
"git log" family of commands, even when run from a subdirectory,
do not limit the revision range with the current directory as
the path limiter, but with double-dash without any paths after
it, i.e. "git log --" do so.  It was a mistake to have a
difference between "git log --" and "git log" introduced in
commit ae563542bf10fa8c33abd2a354e4b28aca4264d7 (First cut at
libifying revlist generation).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c

index 51fff0ec5048478392c140a9f2b68c3650220b10..c193c3ea229be39472cc1f569632b0adc1a7e5d9 100644 (file)
@@ -896,7 +896,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
                        continue;
                argv[i] = NULL;
                argc = i;
-               revs->prune_data = get_pathspec(revs->prefix, argv + i + 1);
+               if (argv[i + 1])
+                       revs->prune_data = get_pathspec(revs->prefix, argv + i + 1);
                seen_dashdash = 1;
                break;
        }