summaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-02-14 06:08:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-14 19:26:37 (GMT)
commit73fc7b6b9be495e2cabc546ed240efd77adaa8eb (patch)
tree55f960b2d80417ce46b26638e34db7b4f7ab1022 /builtin/grep.c
parentd0ffc069331b490ca15418ca7025d5b9024fbad5 (diff)
downloadgit-73fc7b6b9be495e2cabc546ed240efd77adaa8eb.zip
git-73fc7b6b9be495e2cabc546ed240efd77adaa8eb.tar.gz
git-73fc7b6b9be495e2cabc546ed240efd77adaa8eb.tar.bz2
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index c4c6325..1454bef 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,