From: Junio C Hamano Date: Tue, 4 Jul 2006 09:31:50 +0000 (-0700) Subject: git-grep: fix parsing of pathspec separator '--' X-Git-Tag: v1.4.2-rc1~86^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5390590f6d72ffb80da74ed4cbc8648400ea3481;p=git.git git-grep: fix parsing of pathspec separator '--' We used to misparse git grep -e foo -- '*.sh' Signed-off-by: Junio C Hamano --- diff --git a/builtin-grep.c b/builtin-grep.c index 2e7986cec..a8bec72f8 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -817,8 +817,12 @@ int cmd_grep(int argc, const char **argv, char **envp) } usage(builtin_grep_usage); } - if (!strcmp("--", arg)) + if (!strcmp("--", arg)) { + /* later processing wants to have this at argv[1] */ + argv--; + argc++; break; + } if (*arg == '-') usage(builtin_grep_usage);