3 test_description
='Return value of diffs'
7 test_expect_success
'setup' '
10 git commit -m first &&
13 git commit -a -m second
16 test_expect_success
'git diff-tree HEAD^ HEAD' '
17 git diff-tree --exit-code HEAD^ HEAD
20 test_expect_success
'git diff-tree HEAD^ HEAD -- a' '
21 git diff-tree --exit-code HEAD^ HEAD -- a
24 test_expect_success
'git diff-tree HEAD^ HEAD -- b' '
25 git diff-tree --exit-code HEAD^ HEAD -- b
28 test_expect_success
'echo HEAD | git diff-tree --stdin' '
29 echo $(git rev-parse HEAD) | git diff-tree --exit-code --stdin
32 test_expect_success
'git diff-tree HEAD HEAD' '
33 git diff-tree --exit-code HEAD HEAD
36 test_expect_success
'git diff-files' '
37 git diff-files --exit-code
40 test_expect_success
'git diff-index --cached HEAD' '
41 git diff-index --exit-code --cached HEAD
44 test_expect_success
'git diff-index --cached HEAD^' '
45 git diff-index --exit-code --cached HEAD^
48 test_expect_success
'git diff-index --cached HEAD^' '
52 git diff-index --exit-code --cached HEAD^
56 test_expect_success
'git diff-tree -Stext HEAD^ HEAD -- b' '
57 git commit -m "text in b" && {
58 git diff-tree -p --exit-code -Stext HEAD^ HEAD -- b
62 test_expect_success
'git diff-tree -Snot-found HEAD^ HEAD -- b' '
63 git diff-tree -p --exit-code -Snot-found HEAD^ HEAD -- b
66 test_expect_success
'git diff-files' '
68 git diff-files --exit-code
72 test_expect_success
'git diff-index --cached HEAD' '
73 git update-index c && {
74 git diff-index --exit-code --cached HEAD