3 test_description
='diff --exit-code with whitespace'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success setup
'
15 git commit -m initial &&
18 git commit -a -m second &&
24 test_expect_success
'diff-tree --exit-code' '
25 test_must_fail git diff --exit-code HEAD^ HEAD &&
26 test_must_fail git diff-tree --exit-code HEAD^ HEAD
29 test_expect_success
'diff-tree -b --exit-code' '
30 git diff -b --exit-code HEAD^ HEAD &&
31 git diff-tree -b -p --exit-code HEAD^ HEAD &&
32 git diff-tree -b --exit-code HEAD^ HEAD
35 test_expect_success
'diff-index --cached --exit-code' '
36 test_must_fail git diff --cached --exit-code HEAD &&
37 test_must_fail git diff-index --cached --exit-code HEAD
40 test_expect_success
'diff-index -b -p --cached --exit-code' '
41 git diff -b --cached --exit-code HEAD &&
42 git diff-index -b -p --cached --exit-code HEAD
45 test_expect_success
'diff-index --exit-code' '
46 test_must_fail git diff --exit-code HEAD &&
47 test_must_fail git diff-index --exit-code HEAD
50 test_expect_success
'diff-index -b -p --exit-code' '
51 git diff -b --exit-code HEAD &&
52 git diff-index -b -p --exit-code HEAD
55 test_expect_success
'diff-files --exit-code' '
56 test_must_fail git diff --exit-code &&
57 test_must_fail git diff-files --exit-code
60 test_expect_success
'diff-files -b -p --exit-code' '
61 git diff -b --exit-code &&
62 git diff-files -b -p --exit-code
65 test_expect_success
'diff-files --diff-filter --quiet' '
69 test_must_fail git diff-files --diff-filter=M --quiet
72 test_expect_success
'diff-tree --diff-filter --quiet' '
73 git commit -a -m "worktree state" &&
74 test_must_fail git diff-tree --diff-filter=M --quiet HEAD^ HEAD