Skip to content

Commit 271cb30

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a5828ae commit 271cb30

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

t/t4053-diff-no-index.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ test_expect_success 'setup' '
1616
echo 1 >non/git/b
1717
'
1818

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+
1924
test_expect_success 'git diff --no-index directories' '
2025
test_expect_code 1 git diff --no-index a b >cnt &&
2126
test_line_count = 14 cnt

0 commit comments

Comments
 (0)