Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-02-14 09:08:09 +0300
committerJunio C Hamano <gitster@pobox.com>2017-02-14 22:26:37 +0300
commit73fc7b6b9be495e2cabc546ed240efd77adaa8eb (patch)
tree55f960b2d80417ce46b26638e34db7b4f7ab1022 /t/t7810-grep.sh
parentd0ffc069331b490ca15418ca7025d5b9024fbad5 (diff)
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 't/t7810-grep.sh')
-rwxr-xr-xt/t7810-grep.sh5
1 files changed, 5 insertions, 0 deletions
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 <<EOF
hello.c:int main(int argc, const char **argv)
hello.c: printf("Hello world.\n");