@@ -9,48 +9,51 @@ test_expect_success 'setup binary merge conflict' '
99 git commit -m one &&
1010 echo twoQ2 | q_to_nul >binary &&
1111 git commit -a -m two &&
12+ two=$(git rev-parse --short HEAD:binary) &&
1213 git checkout -b branch-binary HEAD^ &&
1314 echo threeQ3 | q_to_nul >binary &&
1415 git commit -a -m three &&
16+ three=$(git rev-parse --short HEAD:binary) &&
1517 test_must_fail git merge master &&
1618 echo resolvedQhooray | q_to_nul >binary &&
17- git commit -a -m resolved
19+ git commit -a -m resolved &&
20+ res=$(git rev-parse --short HEAD:binary)
1821'
1922
20- cat > expect << ' EOF '
23+ cat > expect << EOF
2124resolved
2225
2326diff --git a/binary b/binary
24- index 7ea6ded..9563691 100644
27+ index $three .. $res 100644
2528Binary files a/binary and b/binary differ
2629resolved
2730
2831diff --git a/binary b/binary
29- index 6197570..9563691 100644
32+ index $two .. $res 100644
3033Binary files a/binary and b/binary differ
3134EOF
3235test_expect_success ' diff -m indicates binary-ness' '
3336 git show --format=%s -m >actual &&
3437 test_cmp expect actual
3538'
3639
37- cat > expect << ' EOF '
40+ cat > expect << EOF
3841resolved
3942
4043diff --combined binary
41- index 7ea6ded,6197570..9563691
44+ index $three , $two .. $res
4245Binary files differ
4346EOF
4447test_expect_success ' diff -c indicates binary-ness' '
4548 git show --format=%s -c >actual &&
4649 test_cmp expect actual
4750'
4851
49- cat > expect << ' EOF '
52+ cat > expect << EOF
5053resolved
5154
5255diff --cc binary
53- index 7ea6ded,6197570..9563691
56+ index $three , $two .. $res
5457Binary files differ
5558EOF
5659test_expect_success ' diff --cc indicates binary-ness' '
@@ -62,47 +65,50 @@ test_expect_success 'setup non-binary with binary attribute' '
6265 git checkout master &&
6366 test_commit one text &&
6467 test_commit two text &&
68+ two=$(git rev-parse --short HEAD:text) &&
6569 git checkout -b branch-text HEAD^ &&
6670 test_commit three text &&
71+ three=$(git rev-parse --short HEAD:text) &&
6772 test_must_fail git merge master &&
6873 test_commit resolved text &&
74+ res=$(git rev-parse --short HEAD:text) &&
6975 echo text -diff >.gitattributes
7076'
7177
72- cat > expect << ' EOF '
78+ cat > expect << EOF
7379resolved
7480
7581diff --git a/text b/text
76- index 2bdf67a..2ab19ae 100644
82+ index $three .. $res 100644
7783Binary files a/text and b/text differ
7884resolved
7985
8086diff --git a/text b/text
81- index f719efd..2ab19ae 100644
87+ index $two .. $res 100644
8288Binary files a/text and b/text differ
8389EOF
8490test_expect_success ' diff -m respects binary attribute' '
8591 git show --format=%s -m >actual &&
8692 test_cmp expect actual
8793'
8894
89- cat > expect << ' EOF '
95+ cat > expect << EOF
9096resolved
9197
9298diff --combined text
93- index 2bdf67a,f719efd..2ab19ae
99+ index $three , $two .. $res
94100Binary files differ
95101EOF
96102test_expect_success ' diff -c respects binary attribute' '
97103 git show --format=%s -c >actual &&
98104 test_cmp expect actual
99105'
100106
101- cat > expect << ' EOF '
107+ cat > expect << EOF
102108resolved
103109
104110diff --cc text
105- index 2bdf67a,f719efd..2ab19ae
111+ index $three , $two .. $res
106112Binary files differ
107113EOF
108114test_expect_success ' diff --cc respects binary attribute' '
@@ -115,11 +121,11 @@ test_expect_success 'setup textconv attribute' '
115121 git config diff.upcase.textconv "tr a-z A-Z <"
116122'
117123
118- cat > expect << ' EOF '
124+ cat > expect << EOF
119125resolved
120126
121127diff --git a/text b/text
122- index 2bdf67a..2ab19ae 100644
128+ index $three .. $res 100644
123129--- a/text
124130+++ b/text
125131@@ -1 +1 @@
@@ -128,7 +134,7 @@ index 2bdf67a..2ab19ae 100644
128134resolved
129135
130136diff --git a/text b/text
131- index f719efd..2ab19ae 100644
137+ index $two .. $res 100644
132138--- a/text
133139+++ b/text
134140@@ -1 +1 @@
@@ -140,11 +146,11 @@ test_expect_success 'diff -m respects textconv attribute' '
140146 test_cmp expect actual
141147'
142148
143- cat > expect << ' EOF '
149+ cat > expect << EOF
144150resolved
145151
146152diff --combined text
147- index 2bdf67a,f719efd..2ab19ae
153+ index $three , $two .. $res
148154--- a/text
149155+++ b/text
150156@@@ -1,1 -1,1 +1,1 @@@
@@ -157,11 +163,11 @@ test_expect_success 'diff -c respects textconv attribute' '
157163 test_cmp expect actual
158164'
159165
160- cat > expect << ' EOF '
166+ cat > expect << EOF
161167resolved
162168
163169diff --cc text
164- index 2bdf67a,f719efd..2ab19ae
170+ index $three , $two .. $res
165171--- a/text
166172+++ b/text
167173@@@ -1,1 -1,1 +1,1 @@@
@@ -174,9 +180,9 @@ test_expect_success 'diff --cc respects textconv attribute' '
174180 test_cmp expect actual
175181'
176182
177- cat > expect << ' EOF '
183+ cat > expect << EOF
178184diff --combined text
179- index 2bdf67a,f719efd..2ab19ae
185+ index $three , $two .. $res
180186--- a/text
181187+++ b/text
182188@@@ -1,1 -1,1 +1,1 @@@
@@ -190,9 +196,9 @@ test_expect_success 'diff-tree plumbing does not respect textconv' '
190196 test_cmp expect actual
191197'
192198
193- cat > expect << ' EOF '
199+ cat > expect << EOF
194200diff --cc text
195- index 2bdf67a,f719efd ..0000000
201+ index $three , $two ..0000000
196202--- a/text
197203+++ b/text
198204@@@ -1,1 -1,1 +1,5 @@@
0 commit comments