Skip to content

Commit 1caaf22

Browse files
smoofragitster
authored andcommitted
git-diff: add a test for git diff --quiet -w
This patch adds two test cases for: 6977c25 git diff --quiet -w: check and report the status Signed-off-by: Larry D'Anna <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6977c25 commit 1caaf22

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

t/t4017-diff-retval.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ test_description='Return value of diffs'
55
. ./test-lib.sh
66

77
test_expect_success 'setup' '
8+
echo "1 " >a &&
9+
git add . &&
10+
git commit -m zeroth &&
811
echo 1 >a &&
912
git add . &&
1013
git commit -m first &&
@@ -13,6 +16,18 @@ test_expect_success 'setup' '
1316
git commit -a -m second
1417
'
1518

19+
test_expect_success 'git diff --quiet -w HEAD^^ HEAD^' '
20+
git diff --quiet -w HEAD^^ HEAD^
21+
'
22+
23+
test_expect_success 'git diff --quiet HEAD^^ HEAD^' '
24+
test_must_fail git diff --quiet HEAD^^ HEAD^
25+
'
26+
27+
test_expect_success 'git diff --quiet -w HEAD^ HEAD' '
28+
test_must_fail git diff --quiet -w HEAD^ HEAD
29+
'
30+
1631
test_expect_success 'git diff-tree HEAD^ HEAD' '
1732
git diff-tree --exit-code HEAD^ HEAD
1833
test $? = 1

0 commit comments

Comments
 (0)