30
30
31
31
test_expect_success ' Diff stat with some local changes' '
32
32
stg diff --stat > add-foo-stat.diff &&
33
- diff -u add-foo-stat.diff expected-add-foo-stat.diff
33
+ test_cmp add-foo-stat.diff expected-add-foo-stat.diff
34
34
'
35
35
36
36
test_expect_success ' Diff with bad diff-opts' '
@@ -44,7 +44,7 @@ test_expect_success 'Initialize StGit stuff' '
44
44
45
45
test_expect_success ' Diff with some local changes' '
46
46
stg diff > add-foo2.diff &&
47
- diff -u add-foo.diff add-foo2.diff
47
+ test_cmp add-foo.diff add-foo2.diff
48
48
'
49
49
50
50
test_expect_success ' Refresh patch' '
@@ -77,9 +77,9 @@ test_expect_success 'Add more patches' '
77
77
78
78
test_expect_success ' Diff revs parent-child' '
79
79
stg diff -r foo..bar > foo-bar.diff &&
80
- diff -u foo-bar.diff bar.diff &&
80
+ test_cmp foo-bar.diff bar.diff &&
81
81
stg diff -r foo..bar --stat > foo-bar-stat.diff &&
82
- diff -u foo-bar-stat.diff bar-stat.diff
82
+ test_cmp foo-bar-stat.diff bar-stat.diff
83
83
'
84
84
85
85
test_expect_success ' Diff invalid rev patch name' '
@@ -108,11 +108,11 @@ EOF
108
108
test_expect_success ' Diff range just rev1' '
109
109
stg diff -r bar.. > bar-head.diff &&
110
110
stg diff -r bar.. --stat > bar-head-stat.diff &&
111
- diff -u bar-head-stat.diff expected-bar-head-stat.diff &&
111
+ test_cmp bar-head-stat.diff expected-bar-head-stat.diff &&
112
112
stg diff -r bar..p4 > bar-p4.diff &&
113
- diff -u bar-head.diff bar-p4.diff &&
113
+ test_cmp bar-head.diff bar-p4.diff &&
114
114
stg diff -r bar > bar-only.diff &&
115
- diff -u bar-head.diff bar-only.diff
115
+ test_cmp bar-head.diff bar-only.diff
116
116
'
117
117
118
118
test_expect_success ' Diff range with path' '
@@ -129,9 +129,9 @@ test_expect_success 'Diff from dir' '
129
129
(
130
130
cd dir0 &&
131
131
stg diff > threes2.diff &&
132
- diff -u ../threes.diff threes2.diff &&
132
+ test_cmp ../threes.diff threes2.diff &&
133
133
stg diff ../bar.txt > threes-bar2.diff &&
134
- diff -u ../threes-bar.diff threes-bar2.diff &&
134
+ test_cmp ../threes-bar.diff threes-bar2.diff &&
135
135
test -z "$(stg diff dir1/baz.txt)"
136
136
)
137
137
'
161
161
162
162
test_expect_success ' Binary diff stat' '
163
163
stg diff --stat > num-stat.diff &&
164
- diff -u num-stat.diff expected-num-stat.diff
164
+ test_cmp num-stat.diff expected-num-stat.diff
165
165
'
166
166
167
167
test_expect_success ' Refresh binary' '
@@ -171,12 +171,12 @@ test_expect_success 'Refresh binary' '
171
171
172
172
test_expect_success ' Binary diff range' '
173
173
stg diff -r p5..p6 > num2.diff &&
174
- diff -u num.diff num2.diff
174
+ test_cmp num.diff num2.diff
175
175
'
176
176
177
177
test_expect_success ' Binary diff range with --binary' '
178
178
stg diff -r p5..p6 --diff-opts=--binary > num-binary2.diff &&
179
- diff -u num-binary.diff num-binary2.diff
179
+ test_cmp num-binary.diff num-binary2.diff
180
180
'
181
181
182
182
test_done
0 commit comments