@@ -29,67 +29,65 @@ test_expect_success 'setup' '
29
29
'
30
30
31
31
test_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
34
34
'
35
35
test_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
38
38
'
39
39
test_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
42
42
'
43
43
# this diff outputs one line: sha1 of the given head
44
44
test_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
47
48
'
48
49
test_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
51
52
'
52
53
test_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
55
56
'
56
57
test_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
59
60
'
60
61
test_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
63
64
'
64
65
test_expect_success ' git diff-index --cached HEAD^' '
65
66
echo text >>b &&
66
67
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
71
71
'
72
72
test_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
77
76
'
78
77
test_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
81
80
'
82
81
test_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
87
85
'
86
+
88
87
test_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
93
91
'
94
92
95
93
test_expect_success ' git diff, one file outside repo' '
0 commit comments