aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-07-04 02:31:50 -0700
committerJunio C Hamano <junkio@cox.net>2006-07-04 03:15:46 -0700
commit5390590f6d72ffb80da74ed4cbc8648400ea3481 (patch)
tree400903624cd52dfaf788409f6d820942366ae0bc
parent4d62eaabeb283d6dab56cfb2f2e54144b98afafd (diff)
downloadgit-5390590f6d72ffb80da74ed4cbc8648400ea3481.tar.gz
git-5390590f6d72ffb80da74ed4cbc8648400ea3481.tar.xz
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>
-rw-r--r--builtin-grep.c6
1 files changed, 5 insertions, 1 deletions
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);