Browse Source

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>
maint
Junio C Hamano 19 years ago
parent
commit
5390590f6d
  1. 6
      builtin-grep.c

6
builtin-grep.c

@ -817,8 +817,12 @@ int cmd_grep(int argc, const char **argv, char **envp) @@ -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);


Loading…
Cancel
Save