@matheusbsbs / matheus-bagliano / commits / 5bd74506cd
Fork 0

Get rid of the dependency to GNU diff in the tests

Now that "git diff" handles stdin and relative paths outside the working tree correctly, we can convert all instances of "diff -u" to "git diff". This commit is really the result of $ perl -pi.bak -e 's/diff -u/git diff/' $(git grep -l "diff -u" t/) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from commit c699a40d68215c7e44a5b26117a35c8a56fbd387)

Johannes Schindelin committed Feb 25, 2007 at 23:36 UTC 5bd74506cd30e897d1493639b7438c6cc80dea8e
29 files changed +110 -110
t/diff-lib.sh
+3 -3
@@ -11,7 +11,7 @@ compare_diff_raw () {
11
12 sed -e "$sanitize_diff_raw" <"$1" >.tmp-1
13 sed -e "$sanitize_diff_raw" <"$2" >.tmp-2
14 - diff -u .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
14 + git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
15 }
16
17 sanitize_diff_raw_z='/^:/s/ '"$_x40"' '"$_x40"' \([A-Z]\)[0-9]*$/ X X \1#/'
@@ -23,7 +23,7 @@ compare_diff_raw_z () {
23
24 tr '\0' '\012' <"$1" | sed -e "$sanitize_diff_raw_z" >.tmp-1
25 tr '\0' '\012' <"$2" | sed -e "$sanitize_diff_raw_z" >.tmp-2
26 - diff -u .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
26 + git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
27 }
28
29 compare_diff_patch () {
@@ -37,5 +37,5 @@ compare_diff_patch () {
37 /^[dis]*imilarity index [0-9]*%$/d
38 /^index [0-9a-f]*\.\.[0-9a-f]/d
39 ' <"$2" >.tmp-2
40 - diff -u .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
40 + git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
41 }
t/t1000-read-tree-m-3way.sh
+1 -1
@@ -131,7 +131,7 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
131
132 check_result () {
133 git-ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current &&
134 - diff -u expected current
134 + git diff expected current
135 }
136
137 # This is done on an empty work directory, which is the normal
t/t1001-read-tree-m-2way.sh
+13 -13
@@ -33,7 +33,7 @@ compare_change () {
33 -e '/^--- /d; /^+++ /d; /^@@ /d;' \
34 -e 's/^\([-+][0-7][0-7][0-7][0-7][0-7][0-7]\) '"$_x40"' /\1 X /p' \
35 "$1"
36 - diff -u expected current
36 + git diff expected current
37 }
38
39 check_cache_at () {
@@ -86,7 +86,7 @@ test_expect_success \
86 'rm -f .git/index &&
87 read_tree_twoway $treeH $treeM &&
88 git-ls-files --stage >1-3.out &&
89 - diff -u M.out 1-3.out &&
89 + git diff M.out 1-3.out &&
90 check_cache_at bozbar dirty &&
91 check_cache_at frotz dirty &&
92 check_cache_at nitfol dirty'
@@ -101,7 +101,7 @@ test_expect_success \
101 git-update-index --add yomin &&
102 read_tree_twoway $treeH $treeM &&
103 git-ls-files --stage >4.out || return 1
104 - diff -u M.out 4.out >4diff.out
104 + git diff M.out 4.out >4diff.out
105 compare_change 4diff.out expected &&
106 check_cache_at yomin clean'
107
@@ -115,7 +115,7 @@ test_expect_success \
115 echo yomin yomin >yomin &&
116 read_tree_twoway $treeH $treeM &&
117 git-ls-files --stage >5.out || return 1
118 - diff -u M.out 5.out >5diff.out
118 + git diff M.out 5.out >5diff.out
119 compare_change 5diff.out expected &&
120 check_cache_at yomin dirty'
121
@@ -127,7 +127,7 @@ test_expect_success \
127 git-update-index --add frotz &&
128 read_tree_twoway $treeH $treeM &&
129 git-ls-files --stage >6.out &&
130 - diff -u M.out 6.out &&
130 + git diff M.out 6.out &&
131 check_cache_at frotz clean'
132
133 test_expect_success \
@@ -140,7 +140,7 @@ test_expect_success \
140 echo frotz frotz >frotz &&
141 read_tree_twoway $treeH $treeM &&
142 git-ls-files --stage >7.out &&
143 - diff -u M.out 7.out &&
143 + git diff M.out 7.out &&
144 check_cache_at frotz dirty'
145
146 test_expect_success \
@@ -171,7 +171,7 @@ test_expect_success \
171 git-update-index --add rezrov &&
172 read_tree_twoway $treeH $treeM &&
173 git-ls-files --stage >10.out &&
174 - diff -u M.out 10.out'
174 + git diff M.out 10.out'
175
176 test_expect_success \
177 '11 - dirty path removed.' \
@@ -216,7 +216,7 @@ test_expect_success \
216 git-update-index --add nitfol &&
217 read_tree_twoway $treeH $treeM &&
218 git-ls-files --stage >14.out || return 1
219 - diff -u M.out 14.out >14diff.out
219 + git diff M.out 14.out >14diff.out
220 compare_change 14diff.out expected &&
221 check_cache_at nitfol clean'
222
@@ -230,7 +230,7 @@ test_expect_success \
230 echo nitfol nitfol nitfol >nitfol &&
231 read_tree_twoway $treeH $treeM &&
232 git-ls-files --stage >15.out || return 1
233 - diff -u M.out 15.out >15diff.out
233 + git diff M.out 15.out >15diff.out
234 compare_change 15diff.out expected &&
235 check_cache_at nitfol dirty'
236
@@ -262,7 +262,7 @@ test_expect_success \
262 git-update-index --add bozbar &&
263 read_tree_twoway $treeH $treeM &&
264 git-ls-files --stage >18.out &&
265 - diff -u M.out 18.out &&
265 + git diff M.out 18.out &&
266 check_cache_at bozbar clean'
267
268 test_expect_success \
@@ -275,7 +275,7 @@ test_expect_success \
275 echo gnusto gnusto >bozbar &&
276 read_tree_twoway $treeH $treeM &&
277 git-ls-files --stage >19.out &&
278 - diff -u M.out 19.out &&
278 + git diff M.out 19.out &&
279 check_cache_at bozbar dirty'
280
281 test_expect_success \
@@ -287,7 +287,7 @@ test_expect_success \
287 git-update-index --add bozbar &&
288 read_tree_twoway $treeH $treeM &&
289 git-ls-files --stage >20.out &&
290 - diff -u M.out 20.out &&
290 + git diff M.out 20.out &&
291 check_cache_at bozbar dirty'
292
293 test_expect_success \
@@ -337,7 +337,7 @@ test_expect_success \
337 git-update-index --add DF &&
338 read_tree_twoway $treeDF $treeDFDF &&
339 git-ls-files --stage >DFDFcheck.out &&
340 - diff -u DFDF.out DFDFcheck.out &&
340 + git diff DFDF.out DFDFcheck.out &&
341 check_cache_at DF/DF dirty &&
342 :'
343
t/t1002-read-tree-m-u-2way.sh
+1 -1
@@ -16,7 +16,7 @@ compare_change () {
16 sed >current \
17 -e '/^--- /d; /^+++ /d; /^@@ /d;' \
18 -e 's/^\(.[0-7][0-7][0-7][0-7][0-7][0-7]\) '"$_x40"' /\1 X /' "$1"
19 - diff -u expected current
19 + git diff expected current
20 }
21
22 check_cache_at () {
t/t1300-repo-config.sh
+3 -3
@@ -368,12 +368,12 @@ cat > expect << EOF
368 weird
369 EOF
370
371 -test_expect_success "rename succeeded" "diff -u expect .git/config"
371 +test_expect_success "rename succeeded" "git diff expect .git/config"
372
373 test_expect_failure "rename non-existing section" \
374 'git-config --rename-section branch."world domination" branch.drei'
375
376 -test_expect_success "rename succeeded" "diff -u expect .git/config"
376 +test_expect_success "rename succeeded" "git diff expect .git/config"
377
378 test_expect_success "rename another section" \
379 'git-config --rename-section branch."1 234 blabl/a" branch.drei'
@@ -389,7 +389,7 @@ cat > expect << EOF
389 weird
390 EOF
391
392 -test_expect_success "rename succeeded" "diff -u expect .git/config"
392 +test_expect_success "rename succeeded" "git diff expect .git/config"
393
394 test_expect_success numbers '
395
t/t3001-ls-files-others-exclude.sh
+2 -2
@@ -65,7 +65,7 @@ test_expect_success \
65 --exclude-per-directory=.gitignore \
66 --exclude-from=.git/ignore \
67 >output &&
68 - diff -u expect output'
68 + git diff expect output'
69
70 # Test \r\n (MSDOS-like systems)
71 printf '*.1\r\n/*.3\r\n!*.6\r\n' >.gitignore
@@ -77,6 +77,6 @@ test_expect_success \
77 --exclude-per-directory=.gitignore \
78 --exclude-from=.git/ignore \
79 >output &&
80 - diff -u expect output'
80 + git diff expect output'
81
82 test_done
t/t3002-ls-files-dashpath.sh
+5 -5
@@ -23,7 +23,7 @@ test_expect_success \
23 test_expect_success \
24 'git-ls-files without path restriction.' \
25 'git-ls-files --others >output &&
26 - diff -u output - <<EOF
26 + git diff output - <<EOF
27 --
28 -foo
29 output
@@ -34,7 +34,7 @@ EOF
34 test_expect_success \
35 'git-ls-files with path restriction.' \
36 'git-ls-files --others path0 >output &&
37 - diff -u output - <<EOF
37 + git diff output - <<EOF
38 path0
39 EOF
40 '
@@ -42,7 +42,7 @@ EOF
42 test_expect_success \
43 'git-ls-files with path restriction with --.' \
44 'git-ls-files --others -- path0 >output &&
45 - diff -u output - <<EOF
45 + git diff output - <<EOF
46 path0
47 EOF
48 '
@@ -50,7 +50,7 @@ EOF
50 test_expect_success \
51 'git-ls-files with path restriction with -- --.' \
52 'git-ls-files --others -- -- >output &&
53 - diff -u output - <<EOF
53 + git diff output - <<EOF
54 --
55 EOF
56 '
@@ -58,7 +58,7 @@ EOF
58 test_expect_success \
59 'git-ls-files with no path restriction.' \
60 'git-ls-files --others -- >output &&
61 - diff -u output - <<EOF
61 + git diff output - <<EOF
62 --
63 -foo
64 output
t/t3100-ls-tree-restrict.sh
+1 -1
@@ -35,7 +35,7 @@ _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
35 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
36 test_output () {
37 sed -e "s/ $_x40 / X /" <current >check
38 - diff -u expected check
38 + git diff expected check
39 }
40
41 test_expect_success \
t/t3101-ls-tree-dirname.sh
+1 -1
@@ -43,7 +43,7 @@ _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
43 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
44 test_output () {
45 sed -e "s/ $_x40 / X /" <current >check
46 - diff -u expected check
46 + git diff expected check
47 }
48
49 test_expect_success \
t/t3300-funny-names.sh
+15 -15
@@ -35,7 +35,7 @@ no-funny' >expected
35 test_expect_success 'git-ls-files no-funny' \
36 'git-update-index --add "$p0" "$p2" &&
37 git-ls-files >current &&
38 - diff -u expected current'
38 + git diff expected current'
39
40 t0=`git-write-tree`
41 echo "$t0" >t0
@@ -48,14 +48,14 @@ EOF
48 test_expect_success 'git-ls-files with-funny' \
49 'git-update-index --add "$p1" &&
50 git-ls-files >current &&
51 - diff -u expected current'
51 + git diff expected current'
52
53 echo 'just space
54 no-funny
55 tabs ," (dq) and spaces' >expected
56 test_expect_success 'git-ls-files -z with-funny' \
57 'git-ls-files -z | tr \\0 \\012 >current &&
58 - diff -u expected current'
58 + git diff expected current'
59
60 t1=`git-write-tree`
61 echo "$t1" >t1
@@ -67,28 +67,28 @@ no-funny
67 EOF
68 test_expect_success 'git-ls-tree with funny' \
69 'git-ls-tree -r $t1 | sed -e "s/^[^ ]* //" >current &&
70 - diff -u expected current'
70 + git diff expected current'
71
72 cat > expected <<\EOF
73 A "tabs\t,\" (dq) and spaces"
74 EOF
75 test_expect_success 'git-diff-index with-funny' \
76 'git-diff-index --name-status $t0 >current &&
77 - diff -u expected current'
77 + git diff expected current'
78
79 test_expect_success 'git-diff-tree with-funny' \
80 'git-diff-tree --name-status $t0 $t1 >current &&
81 - diff -u expected current'
81 + git diff expected current'
82
83 echo 'A
84 tabs ," (dq) and spaces' >expected
85 test_expect_success 'git-diff-index -z with-funny' \
86 'git-diff-index -z --name-status $t0 | tr \\0 \\012 >current &&
87 - diff -u expected current'
87 + git diff expected current'
88
89 test_expect_success 'git-diff-tree -z with-funny' \
90 'git-diff-tree -z --name-status $t0 $t1 | tr \\0 \\012 >current &&
91 - diff -u expected current'
91 + git diff expected current'
92
93 cat > expected <<\EOF
94 CNUM no-funny "tabs\t,\" (dq) and spaces"
@@ -96,7 +96,7 @@ EOF
96 test_expect_success 'git-diff-tree -C with-funny' \
97 'git-diff-tree -C --find-copies-harder --name-status \
98 $t0 $t1 | sed -e 's/^C[0-9]*/CNUM/' >current &&
99 - diff -u expected current'
99 + git diff expected current'
100
101 cat > expected <<\EOF
102 RNUM no-funny "tabs\t,\" (dq) and spaces"
@@ -105,7 +105,7 @@ test_expect_success 'git-diff-tree delete with-funny' \
105 'git-update-index --force-remove "$p0" &&
106 git-diff-index -M --name-status \
107 $t0 | sed -e 's/^R[0-9]*/RNUM/' >current &&
108 - diff -u expected current'
108 + git diff expected current'
109
110 cat > expected <<\EOF
111 diff --git a/no-funny "b/tabs\t,\" (dq) and spaces"
@@ -116,7 +116,7 @@ EOF
116 test_expect_success 'git-diff-tree delete with-funny' \
117 'git-diff-index -M -p $t0 |
118 sed -e "s/index [0-9]*%/index NUM%/" >current &&
119 - diff -u expected current'
119 + git diff expected current'
120
121 chmod +x "$p1"
122 cat > expected <<\EOF
@@ -130,7 +130,7 @@ EOF
130 test_expect_success 'git-diff-tree delete with-funny' \
131 'git-diff-index -M -p $t0 |
132 sed -e "s/index [0-9]*%/index NUM%/" >current &&
133 - diff -u expected current'
133 + git diff expected current'
134
135 cat >expected <<\EOF
136 "tabs\t,\" (dq) and spaces"
@@ -139,7 +139,7 @@ EOF
139 test_expect_success 'git-diff-tree rename with-funny applied' \
140 'git-diff-index -M -p $t0 |
141 git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
142 - diff -u expected current'
142 + git diff expected current'
143
144 cat > expected <<\EOF
145 no-funny
@@ -149,12 +149,12 @@ EOF
149 test_expect_success 'git-diff-tree delete with-funny applied' \
150 'git-diff-index -p $t0 |
151 git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
152 - diff -u expected current'
152 + git diff expected current'
153
154 test_expect_success 'git-apply non-git diff' \
155 'git-diff-index -p $t0 |
156 sed -ne "/^[-+@]/p" |
157 git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
158 - diff -u expected current'
158 + git diff expected current'
159
160 test_done
t/t3900-i18n-commit.sh
+1 -1
@@ -9,7 +9,7 @@ test_description='commit and log output encodings'
9
10 compare_with () {
11 git-show -s $1 | sed -e '1,/^$/d' -e 's/^ //' -e '$d' >current &&
12 - diff -u current "$2"
12 + git diff current "$2"
13 }
14
15 test_expect_success setup '
t/t4006-diff-mode.sh
+1 -1
@@ -38,7 +38,7 @@ echo ":100644 100755 X X M rezrov" >expected
38
39 test_expect_success \
40 'verify' \
41 - 'diff -u expected check'
41 + 'git diff expected check'
42
43 test_done
44
t/t4013-diff-various.sh
+1 -1
@@ -111,7 +111,7 @@ do
111 } >"$actual" &&
112 if test -f "$expect"
113 then
114 - diff -u "$expect" "$actual" &&
114 + git diff "$expect" "$actual" &&
115 rm -f "$actual"
116 else
117 # this is to help developing new tests.
t/t4015-diff-whitespace.sh
+6 -6
@@ -43,13 +43,13 @@ index adf3937..6edc172 100644
43 EOF
44
45 git-diff > out
46 -test_expect_success "Ray's example without options" 'diff -u expect out'
46 +test_expect_success "Ray's example without options" 'git diff expect out'
47
48 git-diff -w > out
49 -test_expect_success "Ray's example with -w" 'diff -u expect out'
49 +test_expect_success "Ray's example with -w" 'git diff expect out'
50
51 git-diff -b > out
52 -test_expect_success "Ray's example with -b" 'diff -u expect out'
52 +test_expect_success "Ray's example with -b" 'git diff expect out'
53
54 tr 'Q' '\015' << EOF > x
55 whitespace at beginning
@@ -90,14 +90,14 @@ index d99af23..8b32fb5 100644
90 +CR at end
91 EOF
92 git-diff > out
93 -test_expect_success 'another test, without options' 'diff -u expect out'
93 +test_expect_success 'another test, without options' 'git diff expect out'
94
95 cat << EOF > expect
96 diff --git a/x b/x
97 index d99af23..8b32fb5 100644
98 EOF
99 git-diff -w > out
100 -test_expect_success 'another test, with -w' 'diff -u expect out'
100 +test_expect_success 'another test, with -w' 'git diff expect out'
101
102 tr 'Q' '\015' << EOF > expect
103 diff --git a/x b/x
@@ -115,6 +115,6 @@ index d99af23..8b32fb5 100644
115 CR at endQ
116 EOF
117 git-diff -b > out
118 -test_expect_success 'another test, with -b' 'diff -u expect out'
118 +test_expect_success 'another test, with -b' 'git diff expect out'
119
120 test_done
t/t4016-diff-quote.sh
+2 -2
@@ -49,7 +49,7 @@ cat >expect <<\EOF
49 EOF
50 test_expect_success 'git diff --summary -M HEAD' '
51 git diff --summary -M HEAD >actual &&
52 - diff -u expect actual
52 + git diff expect actual
53 '
54
55 cat >expect <<\EOF
@@ -64,7 +64,7 @@ cat >expect <<\EOF
64 EOF
65 test_expect_success 'git diff --stat -M HEAD' '
66 git diff --stat -M HEAD >actual &&
67 - diff -u expect actual
67 + git diff expect actual
68 '
69
70 test_done
t/t4100-apply-stat.sh
+7 -7
@@ -11,37 +11,37 @@ test_description='git-apply --stat --summary test.
11 test_expect_success \
12 'rename' \
13 'git-apply --stat --summary <../t4100/t-apply-1.patch >current &&
14 - diff -u ../t4100/t-apply-1.expect current'
14 + git diff ../t4100/t-apply-1.expect current'
15
16 test_expect_success \
17 'copy' \
18 'git-apply --stat --summary <../t4100/t-apply-2.patch >current &&
19 - diff -u ../t4100/t-apply-2.expect current'
19 + git diff ../t4100/t-apply-2.expect current'
20
21 test_expect_success \
22 'rewrite' \
23 'git-apply --stat --summary <../t4100/t-apply-3.patch >current &&
24 - diff -u ../t4100/t-apply-3.expect current'
24 + git diff ../t4100/t-apply-3.expect current'
25
26 test_expect_success \
27 'mode' \
28 'git-apply --stat --summary <../t4100/t-apply-4.patch >current &&
29 - diff -u ../t4100/t-apply-4.expect current'
29 + git diff ../t4100/t-apply-4.expect current'
30
31 test_expect_success \
32 'non git' \
33 'git-apply --stat --summary <../t4100/t-apply-5.patch >current &&
34 - diff -u ../t4100/t-apply-5.expect current'
34 + git diff ../t4100/t-apply-5.expect current'
35
36 test_expect_success \
37 'non git' \
38 'git-apply --stat --summary <../t4100/t-apply-6.patch >current &&
39 - diff -u ../t4100/t-apply-6.expect current'
39 + git diff ../t4100/t-apply-6.expect current'
40
41 test_expect_success \
42 'non git' \
43 'git-apply --stat --summary <../t4100/t-apply-7.patch >current &&
44 - diff -u ../t4100/t-apply-7.expect current'
44 + git diff ../t4100/t-apply-7.expect current'
45
46 test_done
47
t/t4104-apply-boundary.sh
+2 -2
@@ -90,7 +90,7 @@ do
90 cat '"$kind-patch.$with"'
91 (exit 1)
92 } &&
93 - diff -u '"$kind"'-expect victim
93 + git diff '"$kind"'-expect victim
94 '
95 done
96 done
@@ -108,7 +108,7 @@ do
108 cat '"$kind-ng.without"'
109 (exit 1)
110 } &&
111 - diff -u '"$kind"'-expect victim
111 + git diff '"$kind"'-expect victim
112 '
113 done
114
t/t4115-apply-symlink.sh
+2 -2
@@ -33,7 +33,7 @@ test_expect_success 'apply symlink patch' '
33 git checkout side &&
34 git apply patch &&
35 git diff-files -p >patched &&
36 - diff -u patch patched
36 + git diff patch patched
37
38 '
39
@@ -42,7 +42,7 @@ test_expect_success 'apply --index symlink patch' '
42 git checkout -f side &&
43 git apply --index patch &&
44 git diff-index --cached -p HEAD >patched &&
45 - diff -u patch patched
45 + git diff patch patched
46
47 '
48
t/t4116-apply-reverse.sh
+1 -1
@@ -42,7 +42,7 @@ test_expect_success 'apply in reverse' '
42 git reset --hard second &&
43 git apply --reverse --binary --index patch &&
44 git diff >diff &&
45 - diff -u /dev/null diff
45 + git diff /dev/null diff
46
47 '
48
t/t4117-apply-reject.sh
+6 -6
@@ -54,7 +54,7 @@ test_expect_success 'apply without --reject should fail' '
54 exit 1
55 fi
56
57 - diff -u file1 saved.file1
57 + git diff file1 saved.file1
58 '
59
60 test_expect_success 'apply without --reject should fail' '
@@ -65,7 +65,7 @@ test_expect_success 'apply without --reject should fail' '
65 exit 1
66 fi
67
68 - diff -u file1 saved.file1
68 + git diff file1 saved.file1
69 '
70
71 test_expect_success 'apply with --reject should fail but update the file' '
@@ -79,7 +79,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
79 exit 1
80 fi
81
82 - diff -u file1 expected &&
82 + git diff file1 expected &&
83
84 cat file1.rej &&
85
@@ -105,7 +105,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
105 echo "file1 still exists?"
106 exit 1
107 }
108 - diff -u file2 expected &&
108 + git diff file2 expected &&
109
110 cat file2.rej &&
111
@@ -132,7 +132,7 @@ test_expect_success 'the same test with --verbose' '
132 echo "file1 still exists?"
133 exit 1
134 }
135 - diff -u file2 expected &&
135 + git diff file2 expected &&
136
137 cat file2.rej &&
138
@@ -151,7 +151,7 @@ test_expect_success 'apply cleanly with --verbose' '
151
152 git apply --verbose patch.1 &&
153
154 - diff -u file1 clean
154 + git diff file1 clean
155 '
156
157 test_done
t/t4118-apply-empty-context.sh
+3 -3
@@ -37,7 +37,7 @@ test_expect_success 'apply --numstat' '
37 echo "0 1 file1" &&
38 echo "0 1 file2"
39 } >expect &&
40 - diff -u expect actual
40 + git diff expect actual
41
42 '
43
@@ -47,8 +47,8 @@ test_expect_success 'apply --apply' '
47 cat file2.orig >file2 &&
48 git update-index file1 file2 &&
49 git apply --index diff.output &&
50 - diff -u file1.mods file1 &&
51 - diff -u file2.mods file2
50 + git diff file1.mods file1 &&
51 + git diff file2.mods file2
52 '
53
54 test_done
t/t4200-rerere.sh
+3 -3
@@ -70,7 +70,7 @@ EOF
70
71 git rerere diff > out
72
73 -test_expect_success 'rerere diff' 'diff -u expect out'
73 +test_expect_success 'rerere diff' 'git diff expect out'
74
75 cat > expect << EOF
76 a1
@@ -78,7 +78,7 @@ EOF
78
79 git rerere status > out
80
81 -test_expect_success 'rerere status' 'diff -u expect out'
81 +test_expect_success 'rerere status' 'git diff expect out'
82
83 test_expect_success 'commit succeeds' \
84 "git commit -q -a -m 'prefer first over second'"
@@ -94,7 +94,7 @@ test_expect_failure 'another conflicting merge' 'git pull . first'
94 git show first:a1 | sed 's/To die: t/To die! T/' > expect
95 test_expect_success 'rerere kicked in' "! grep ======= a1"
96
97 -test_expect_success 'rerere prefers first change' 'diff -u a1 expect'
97 +test_expect_success 'rerere prefers first change' 'git diff a1 expect'
98
99 rm $rr/postimage
100 echo "$sha1 a1" | tr '\012' '\0' > .git/rr-cache/MERGE_RR
t/t5400-send-pack.sh
+1 -1
@@ -110,7 +110,7 @@ test_expect_success \
110 cd .. &&
111 git-update-ref refs/heads/master master^ &&
112 git-send-pack --force ./victim/.git/ master &&
113 - ! diff -u .git/refs/heads/master victim/.git/refs/heads/master
113 + ! git diff .git/refs/heads/master victim/.git/refs/heads/master
114 '
115
116 test_done
t/t5401-update-hooks.sh
+2 -2
@@ -51,12 +51,12 @@ test_expect_success 'hooks ran' '
51
52 test_expect_success 'update hook arguments' '
53 echo refs/heads/master $commit0 $commit1 |
54 - diff -u - victim/.git/update.args
54 + git diff - victim/.git/update.args
55 '
56
57 test_expect_success 'post-update hook arguments' '
58 echo refs/heads/master |
59 - diff -u - victim/.git/post-update.args
59 + git diff - victim/.git/post-update.args
60 '
61
62 test_expect_failure 'update hook stdin is /dev/null' '
t/t6023-merge-file.sh
+4 -4
@@ -63,7 +63,7 @@ test_expect_success "merge without conflict (missing LF at EOF)" \
63 "git-merge-file test2.txt orig.txt new2.txt"
64
65 test_expect_success "merge result added missing LF" \
66 - "diff -u test.txt test2.txt"
66 + "git diff test.txt test2.txt"
67
68 cp test.txt backup.txt
69 test_expect_failure "merge with conflicts" \
@@ -86,7 +86,7 @@ non timebo mala, quoniam tu mecum es:
86 virga tua et baculus tuus ipsa me consolata sunt.
87 EOF
88
89 -test_expect_success "expected conflict markers" "diff -u test.txt expect.txt"
89 +test_expect_success "expected conflict markers" "git diff test.txt expect.txt"
90
91 cp backup.txt test.txt
92 test_expect_failure "merge with conflicts, using -L" \
@@ -110,7 +110,7 @@ virga tua et baculus tuus ipsa me consolata sunt.
110 EOF
111
112 test_expect_success "expected conflict markers, with -L" \
113 - "diff -u test.txt expect.txt"
113 + "git diff test.txt expect.txt"
114
115 sed "s/ tu / TU /" < new1.txt > new5.txt
116 test_expect_failure "conflict in removed tail" \
@@ -132,7 +132,7 @@ virga tua et baculus tuus ipsa me consolata sunt.
132 >>>>>>> new5.txt
133 EOF
134
135 -test_expect_success "expected conflict markers" "diff -u expect out"
135 +test_expect_success "expected conflict markers" "git diff expect out"
136
137 test_done
138
t/t6024-recursive-merge.sh
+2 -2
@@ -70,7 +70,7 @@ G
70 >>>>>>> G:a1
71 EOF
72
73 -test_expect_success "result contains a conflict" "diff -u expect a1"
73 +test_expect_success "result contains a conflict" "git diff expect a1"
74
75 git ls-files --stage > out
76 cat > expect << EOF
@@ -79,6 +79,6 @@ cat > expect << EOF
79 100644 fd7923529855d0b274795ae3349c5e0438333979 3 a1
80 EOF
81
82 -test_expect_success "virtual trees were processed" "diff -u expect out"
82 +test_expect_success "virtual trees were processed" "git diff expect out"
83
84 test_done
t/t6200-fmt-merge-msg.sh
+5 -5
@@ -79,7 +79,7 @@ test_expect_success 'merge-msg test #1' '
79 git fetch . left &&
80
81 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
82 - diff -u actual expected
82 + git diff actual expected
83 '
84
85 cat >expected <<\EOF
@@ -92,7 +92,7 @@ test_expect_success 'merge-msg test #2' '
92 git fetch ../trash left &&
93
94 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
95 - diff -u actual expected
95 + git diff actual expected
96 '
97
98 cat >expected <<\EOF
@@ -115,7 +115,7 @@ test_expect_success 'merge-msg test #3' '
115 git fetch . left &&
116
117 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
118 - diff -u actual expected
118 + git diff actual expected
119 '
120
121 cat >expected <<\EOF
@@ -145,7 +145,7 @@ test_expect_success 'merge-msg test #4' '
145 git fetch . left right &&
146
147 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
148 - diff -u actual expected
148 + git diff actual expected
149 '
150
151 test_expect_success 'merge-msg test #5' '
@@ -157,7 +157,7 @@ test_expect_success 'merge-msg test #5' '
157 git fetch . left right &&
158
159 git fmt-merge-msg <.git/FETCH_HEAD >actual &&
160 - diff -u actual expected
160 + git diff actual expected
161 '
162
163 test_done
t/t9100-git-svn-basic.sh
+3 -3
@@ -169,7 +169,7 @@ test_expect_success "$name" "
169 svn up '$SVN_TREE' &&
170 test -f '$SVN_TREE'/exec-2.sh &&
171 test ! -L '$SVN_TREE'/exec-2.sh &&
172 - diff -u help $SVN_TREE/exec-2.sh"
172 + git diff help $SVN_TREE/exec-2.sh"
173
174 if test "$have_utf8" = t
175 then
@@ -193,7 +193,7 @@ test_expect_success "$name" \
193 "git-svn init $svnrepo && git-svn fetch &&
194 git-rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&
195 git-rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&
196 - diff -u a b"
196 + git diff a b"
197
198 name='check imported tree checksums expected tree checksums'
199 rm -f expected
@@ -211,7 +211,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e
211 tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4
212 EOF
213
214 -test_expect_success "$name" "diff -u a expected"
214 +test_expect_success "$name" "git diff a expected"
215
216 test_expect_failure 'exit if remote refs are ambigious' "
217 git-config --add svn-remote.svn.fetch \
t/t9300-fast-import.sh
+13 -13
@@ -74,7 +74,7 @@ EOF
74 test_expect_success \
75 'A: verify commit' \
76 'git-cat-file commit master | sed 1d >actual &&
77 - diff -u expect actual'
77 + git diff expect actual'
78
79 cat >expect <<EOF
80 100644 blob file2
@@ -84,22 +84,22 @@ EOF
84 test_expect_success \
85 'A: verify tree' \
86 'git-cat-file -p master^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
87 - diff -u expect actual'
87 + git diff expect actual'
88
89 echo "$file2_data" >expect
90 test_expect_success \
91 'A: verify file2' \
92 - 'git-cat-file blob master:file2 >actual && diff -u expect actual'
92 + 'git-cat-file blob master:file2 >actual && git diff expect actual'
93
94 echo "$file3_data" >expect
95 test_expect_success \
96 'A: verify file3' \
97 - 'git-cat-file blob master:file3 >actual && diff -u expect actual'
97 + 'git-cat-file blob master:file3 >actual && git diff expect actual'
98
99 printf "$file4_data" >expect
100 test_expect_success \
101 'A: verify file4' \
102 - 'git-cat-file blob master:file4 >actual && diff -u expect actual'
102 + 'git-cat-file blob master:file4 >actual && git diff expect actual'
103
104 cat >expect <<EOF
105 :2 `git-rev-parse --verify master:file2`
@@ -109,7 +109,7 @@ cat >expect <<EOF
109 EOF
110 test_expect_success \
111 'A: verify marks output' \
112 - 'diff -u expect marks.out'
112 + 'git diff expect marks.out'
113
114 ###
115 ### series B
@@ -175,7 +175,7 @@ EOF
175 test_expect_success \
176 'C: verify commit' \
177 'git-cat-file commit branch | sed 1d >actual &&
178 - diff -u expect actual'
178 + git diff expect actual'
179
180 cat >expect <<EOF
181 :000000 100755 0000000000000000000000000000000000000000 f1fb5da718392694d0076d677d6d0e364c79b0bc A file2/newf
@@ -232,13 +232,13 @@ echo "$file5_data" >expect
232 test_expect_success \
233 'D: verify file5' \
234 'git-cat-file blob branch:newdir/interesting >actual &&
235 - diff -u expect actual'
235 + git diff expect actual'
236
237 echo "$file6_data" >expect
238 test_expect_success \
239 'D: verify file6' \
240 'git-cat-file blob branch:newdir/exec.sh >actual &&
241 - diff -u expect actual'
241 + git diff expect actual'
242
243 ###
244 ### series E
@@ -274,7 +274,7 @@ EOF
274 test_expect_success \
275 'E: verify commit' \
276 'git-cat-file commit branch | sed 1,2d >actual &&
277 - diff -u expect actual'
277 + git diff expect actual'
278
279 ###
280 ### series F
@@ -327,7 +327,7 @@ EOF
327 test_expect_success \
328 'F: verify other commit' \
329 'git-cat-file commit other >actual &&
330 - diff -u expect actual'
330 + git diff expect actual'
331
332 ###
333 ### series G
@@ -405,7 +405,7 @@ echo "$file5_data" >expect
405 test_expect_success \
406 'H: verify file' \
407 'git-cat-file blob H:h/e/l/lo >actual &&
408 - diff -u expect actual'
408 + git diff expect actual'
409
410 ###
411 ### series I
@@ -431,7 +431,7 @@ EOF
431 test_expect_success \
432 'I: verify edge list' \
433 'sed -e s/pack-.*pack/pack-.pack/ edges.list >actual &&
434 - diff -u expect actual'
434 + git diff expect actual'
435
436 ###
437 ### series J