diff --no-index tests: add test for --exit-code

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>

Ævar Arnfjörð Bjarmason committed Mar 21, 2021 at 23:36 UTC 271cb303a507c8e37fa894c36569c18c6d134510
1 file changed +5
t/t4053-diff-no-index.sh
+5
@@ -16,6 +16,11 @@ test_expect_success 'setup' '
16 echo 1 >non/git/b
17 '
18
19 +test_expect_success 'git diff --no-index --exit-code' '
20 + git diff --no-index --exit-code a/1 non/git/a &&
21 + test_expect_code 1 git diff --no-index --exit-code a/1 a/2
22 +'
23 +
24 test_expect_success 'git diff --no-index directories' '
25 test_expect_code 1 git diff --no-index a b >cnt &&
26 test_line_count = 14 cnt