]> git.ipfire.org Git - thirdparty/git.git/commitdiff
diff --no-index tests: add test for --exit-code
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 21 Mar 2021 22:36:19 +0000 (23:36 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Mar 2021 18:48:41 +0000 (11:48 -0700)
Add a test for --exit-code working with --no-index. There's no reason
to suppose it wouldn't, but we weren't testing for it anywhere in our
tests. Let's fix that blind spot.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4053-diff-no-index.sh

index 0168946b6394092bbedc4da6d57ef9ba8e205927..44b932fbb200da024a445bd2859df02c87333afe 100755 (executable)
@@ -16,6 +16,11 @@ test_expect_success 'setup' '
        echo 1 >non/git/b
 '
 
+test_expect_success 'git diff --no-index --exit-code' '
+       git diff --no-index --exit-code a/1 non/git/a &&
+       test_expect_code 1 git diff --no-index --exit-code a/1 a/2
+'
+
 test_expect_success 'git diff --no-index directories' '
        test_expect_code 1 git diff --no-index a b >cnt &&
        test_line_count = 14 cnt