diff mbox series

[v2,1/2] diff --no-index tests: add test for --exit-code

Message ID 2dbc6c253e2725819602fd5a09f491a8bc14ad8e.1616366036.git.avarab@gmail.com (mailing list archive)
State Superseded
Headers show
Series diff --no-index: fix test blind spots | expand

Commit Message

Ævar Arnfjörð Bjarmason March 21, 2021, 10:36 p.m. UTC
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>
---
 t/t4053-diff-no-index.sh | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/t/t4053-diff-no-index.sh b/t/t4053-diff-no-index.sh
index 0168946b639..44b932fbb20 100755
--- a/t/t4053-diff-no-index.sh
+++ b/t/t4053-diff-no-index.sh
@@ -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