@@ -29,67 +29,65 @@ test_expect_success 'setup' '
2929'
3030
3131test_expect_success ' git diff-tree HEAD^ HEAD' '
32- git diff-tree --quiet HEAD^ HEAD >cnt
33- test $? = 1 && test_line_count = 0 cnt
32+ test_expect_code 1 git diff-tree --quiet HEAD^ HEAD >cnt &&
33+ test_line_count = 0 cnt
3434'
3535test_expect_success ' git diff-tree HEAD^ HEAD -- a' '
36- git diff-tree --quiet HEAD^ HEAD -- a >cnt
37- test $? = 0 && test_line_count = 0 cnt
36+ test_expect_code 0 git diff-tree --quiet HEAD^ HEAD -- a >cnt &&
37+ test_line_count = 0 cnt
3838'
3939test_expect_success ' git diff-tree HEAD^ HEAD -- b' '
40- git diff-tree --quiet HEAD^ HEAD -- b >cnt
41- test $? = 1 && test_line_count = 0 cnt
40+ test_expect_code 1 git diff-tree --quiet HEAD^ HEAD -- b >cnt &&
41+ test_line_count = 0 cnt
4242'
4343# this diff outputs one line: sha1 of the given head
4444test_expect_success ' echo HEAD | git diff-tree --stdin' '
45- echo $(git rev-parse HEAD) | git diff-tree --quiet --stdin >cnt
46- test $? = 1 && test_line_count = 1 cnt
45+ echo $(git rev-parse HEAD) |
46+ test_expect_code 1 git diff-tree --quiet --stdin >cnt &&
47+ test_line_count = 1 cnt
4748'
4849test_expect_success ' git diff-tree HEAD HEAD' '
49- git diff-tree --quiet HEAD HEAD >cnt
50- test $? = 0 && test_line_count = 0 cnt
50+ test_expect_code 0 git diff-tree --quiet HEAD HEAD >cnt &&
51+ test_line_count = 0 cnt
5152'
5253test_expect_success ' git diff-files' '
53- git diff-files --quiet >cnt
54- test $? = 0 && test_line_count = 0 cnt
54+ test_expect_code 0 git diff-files --quiet >cnt &&
55+ test_line_count = 0 cnt
5556'
5657test_expect_success ' git diff-index --cached HEAD' '
57- git diff-index --quiet --cached HEAD >cnt
58- test $? = 0 && test_line_count = 0 cnt
58+ test_expect_code 0 git diff-index --quiet --cached HEAD >cnt &&
59+ test_line_count = 0 cnt
5960'
6061test_expect_success ' git diff-index --cached HEAD^' '
61- git diff-index --quiet --cached HEAD^ >cnt
62- test $? = 1 && test_line_count = 0 cnt
62+ test_expect_code 1 git diff-index --quiet --cached HEAD^ >cnt &&
63+ test_line_count = 0 cnt
6364'
6465test_expect_success ' git diff-index --cached HEAD^' '
6566 echo text >>b &&
6667 echo 3 >c &&
67- git add . && {
68- git diff-index --quiet --cached HEAD^ >cnt
69- test $? = 1 && test_line_count = 0 cnt
70- }
68+ git add . &&
69+ test_expect_code 1 git diff-index --quiet --cached HEAD^ >cnt &&
70+ test_line_count = 0 cnt
7171'
7272test_expect_success ' git diff-tree -Stext HEAD^ HEAD -- b' '
73- git commit -m "text in b" && {
74- git diff-tree --quiet -Stext HEAD^ HEAD -- b >cnt
75- test $? = 1 && test_line_count = 0 cnt
76- }
73+ git commit -m "text in b" &&
74+ test_expect_code 1 git diff-tree --quiet -Stext HEAD^ HEAD -- b >cnt &&
75+ test_line_count = 0 cnt
7776'
7877test_expect_success ' git diff-tree -Snot-found HEAD^ HEAD -- b' '
79- git diff-tree --quiet -Snot-found HEAD^ HEAD -- b >cnt
80- test $? = 0 && test_line_count = 0 cnt
78+ test_expect_code 0 git diff-tree --quiet -Snot-found HEAD^ HEAD -- b >cnt &&
79+ test_line_count = 0 cnt
8180'
8281test_expect_success ' git diff-files' '
83- echo 3 >>c && {
84- git diff-files --quiet >cnt
85- test $? = 1 && test_line_count = 0 cnt
86- }
82+ echo 3 >>c &&
83+ test_expect_code 1 git diff-files --quiet >cnt &&
84+ test_line_count = 0 cnt
8785'
86+
8887test_expect_success ' git diff-index --cached HEAD' '
89- git update-index c && {
90- git diff-index --quiet --cached HEAD >cnt
91- test $? = 1 && test_line_count = 0 cnt
92- }
88+ git update-index c &&
89+ test_expect_code 1 git diff-index --quiet --cached HEAD >cnt &&
90+ test_line_count = 0 cnt
9391'
9492
9593test_expect_success ' git diff, one file outside repo' '
0 commit comments