git-grep: fix parsing of pathspec separator '--'
We used to misparse git grep -e foo -- '*.sh' Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jul 4, 2006 at 02:31 UTC
5390590f6d72ffb80da74ed4cbc8648400ea3481
1 file changed
+5
-1
builtin-grep.c
+5
-1
@@ -817,8 +817,12 @@ int cmd_grep(int argc, const char **argv, char **envp)
817
}
818
usage(builtin_grep_usage);
819
}
820
- if (!strcmp("--", arg))
820
+ if (!strcmp("--", arg)) {
821
+ /* later processing wants to have this at argv[1] */
822
+ argv--;
823
+ argc++;
824
break;
825
+ }
826
if (*arg == '-')
827
usage(builtin_grep_usage);
828