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 --- t/t7810-grep.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 't/t7810-grep.sh') diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index c051c7ee80..0ff9f6cae8 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -1043,6 +1043,11 @@ test_expect_success 'grep --no-index prefers paths to revs' ' test_cmp expect actual ' +test_expect_success 'grep --no-index does not "diagnose" revs' ' + test_must_fail git grep --no-index o :1:hello.c 2>err && + test_i18ngrep ! -i "did you mean" err +' + cat >expected <