Skip to content

Commit 2b14d07

Browse files
drafnelgitster
authored andcommitted
t/: Replace diff [-u|-U0] with test_cmp to allow compilation with old diff
Signed-off-by: Brandon Casey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4d175ef commit 2b14d07

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

t/t0002-gitfile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ test_expect_success 'check hash-object' '
6666

6767
test_expect_success 'check cat-file' '
6868
git cat-file blob $SHA >actual &&
69-
diff -u bar actual
69+
test_cmp bar actual
7070
'
7171

7272
test_expect_success 'check update-index' '

t/t1002-read-tree-m-u-2way.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ test_expect_success \
112112
git update-index --add frotz &&
113113
git read-tree -m -u $treeH $treeM &&
114114
git ls-files --stage >6.out &&
115-
diff -U0 M.out 6.out &&
115+
test_cmp M.out 6.out &&
116116
check_cache_at frotz clean &&
117117
sum bozbar frotz nitfol >actual3.sum &&
118118
cmp M.sum actual3.sum &&
@@ -129,7 +129,7 @@ test_expect_success \
129129
echo frotz frotz >frotz &&
130130
git read-tree -m -u $treeH $treeM &&
131131
git ls-files --stage >7.out &&
132-
diff -U0 M.out 7.out &&
132+
test_cmp M.out 7.out &&
133133
check_cache_at frotz dirty &&
134134
sum bozbar frotz nitfol >actual7.sum &&
135135
if cmp M.sum actual7.sum; then false; else :; fi &&
@@ -264,7 +264,7 @@ test_expect_success \
264264
git update-index --add bozbar &&
265265
git read-tree -m -u $treeH $treeM &&
266266
git ls-files --stage >18.out &&
267-
diff -U0 M.out 18.out &&
267+
test_cmp M.out 18.out &&
268268
check_cache_at bozbar clean &&
269269
sum bozbar frotz nitfol >actual18.sum &&
270270
cmp M.sum actual18.sum'
@@ -278,7 +278,7 @@ test_expect_success \
278278
echo gnusto gnusto >bozbar &&
279279
git read-tree -m -u $treeH $treeM &&
280280
git ls-files --stage >19.out &&
281-
diff -U0 M.out 19.out &&
281+
test_cmp M.out 19.out &&
282282
check_cache_at bozbar dirty &&
283283
sum frotz nitfol >actual19.sum &&
284284
grep -v bozbar M.sum > expected19.sum &&
@@ -297,7 +297,7 @@ test_expect_success \
297297
git update-index --add bozbar &&
298298
git read-tree -m -u $treeH $treeM &&
299299
git ls-files --stage >20.out &&
300-
diff -U0 M.out 20.out &&
300+
test_cmp M.out 20.out &&
301301
check_cache_at bozbar clean &&
302302
sum bozbar frotz nitfol >actual20.sum &&
303303
cmp M.sum actual20.sum'
@@ -338,7 +338,7 @@ test_expect_success \
338338
git update-index --add DF &&
339339
git read-tree -m -u $treeDF $treeDFDF &&
340340
git ls-files --stage >DFDFcheck.out &&
341-
diff -U0 DFDF.out DFDFcheck.out &&
341+
test_cmp DFDF.out DFDFcheck.out &&
342342
check_cache_at DF/DF clean'
343343

344344
test_done

t/t2201-add-update-typechange.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,20 @@ test_expect_success modify '
106106

107107
test_expect_success diff-files '
108108
git diff-files --raw >actual &&
109-
diff -u expect-files actual
109+
test_cmp expect-files actual
110110
'
111111

112112
test_expect_success diff-index '
113113
git diff-index --raw HEAD -- >actual &&
114-
diff -u expect-index actual
114+
test_cmp expect-index actual
115115
'
116116

117117
test_expect_success 'add -u' '
118118
rm -f ".git/saved-index" &&
119119
cp -p ".git/index" ".git/saved-index" &&
120120
git add -u &&
121121
git ls-files -s >actual &&
122-
diff -u expect-final actual
122+
test_cmp expect-final actual
123123
'
124124

125125
test_expect_success 'commit -a' '
@@ -130,11 +130,11 @@ test_expect_success 'commit -a' '
130130
fi &&
131131
git commit -m "second" -a &&
132132
git ls-files -s >actual &&
133-
diff -u expect-final actual &&
133+
test_cmp expect-final actual &&
134134
rm -f .git/index &&
135135
git read-tree HEAD &&
136136
git ls-files -s >actual &&
137-
diff -u expect-final actual
137+
test_cmp expect-final actual
138138
'
139139

140140
test_done

0 commit comments

Comments
 (0)