From 73fc7b6b9be495e2cabc546ed240efd77adaa8eb Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 14 Feb 2017 01:08:09 -0500 Subject: grep: do not diagnose misspelt revs with --no-index If we are using --no-index, then our arguments cannot be revs in the first place. Not only is it pointless to diagnose them, but if we are not in a repository, we should not be trying to resolve any names. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin/grep.c') diff --git a/builtin/grep.c b/builtin/grep.c index c4c6325941..1454bef496 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -1201,7 +1201,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix) if (!seen_dashdash) { int j; for (j = i; j < argc; j++) - verify_filename(prefix, argv[j], j == i); + verify_filename(prefix, argv[j], j == i && use_index); } parse_pathspec(&pathspec, 0, -- cgit v1.2.3