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>
This commit is contained in:
Junio C Hamano 2006-07-04 02:31:50 -07:00
parent 4d62eaabeb
commit 5390590f6d

View File

@ -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);