@@ -9,48 +9,51 @@ test_expect_success 'setup binary merge conflict' '
9
9
git commit -m one &&
10
10
echo twoQ2 | q_to_nul >binary &&
11
11
git commit -a -m two &&
12
+ two=$(git rev-parse --short HEAD:binary) &&
12
13
git checkout -b branch-binary HEAD^ &&
13
14
echo threeQ3 | q_to_nul >binary &&
14
15
git commit -a -m three &&
16
+ three=$(git rev-parse --short HEAD:binary) &&
15
17
test_must_fail git merge master &&
16
18
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)
18
21
'
19
22
20
- cat > expect << ' EOF '
23
+ cat > expect << EOF
21
24
resolved
22
25
23
26
diff --git a/binary b/binary
24
- index 7ea6ded..9563691 100644
27
+ index $three .. $res 100644
25
28
Binary files a/binary and b/binary differ
26
29
resolved
27
30
28
31
diff --git a/binary b/binary
29
- index 6197570..9563691 100644
32
+ index $two .. $res 100644
30
33
Binary files a/binary and b/binary differ
31
34
EOF
32
35
test_expect_success ' diff -m indicates binary-ness' '
33
36
git show --format=%s -m >actual &&
34
37
test_cmp expect actual
35
38
'
36
39
37
- cat > expect << ' EOF '
40
+ cat > expect << EOF
38
41
resolved
39
42
40
43
diff --combined binary
41
- index 7ea6ded,6197570..9563691
44
+ index $three , $two .. $res
42
45
Binary files differ
43
46
EOF
44
47
test_expect_success ' diff -c indicates binary-ness' '
45
48
git show --format=%s -c >actual &&
46
49
test_cmp expect actual
47
50
'
48
51
49
- cat > expect << ' EOF '
52
+ cat > expect << EOF
50
53
resolved
51
54
52
55
diff --cc binary
53
- index 7ea6ded,6197570..9563691
56
+ index $three , $two .. $res
54
57
Binary files differ
55
58
EOF
56
59
test_expect_success ' diff --cc indicates binary-ness' '
@@ -62,47 +65,50 @@ test_expect_success 'setup non-binary with binary attribute' '
62
65
git checkout master &&
63
66
test_commit one text &&
64
67
test_commit two text &&
68
+ two=$(git rev-parse --short HEAD:text) &&
65
69
git checkout -b branch-text HEAD^ &&
66
70
test_commit three text &&
71
+ three=$(git rev-parse --short HEAD:text) &&
67
72
test_must_fail git merge master &&
68
73
test_commit resolved text &&
74
+ res=$(git rev-parse --short HEAD:text) &&
69
75
echo text -diff >.gitattributes
70
76
'
71
77
72
- cat > expect << ' EOF '
78
+ cat > expect << EOF
73
79
resolved
74
80
75
81
diff --git a/text b/text
76
- index 2bdf67a..2ab19ae 100644
82
+ index $three .. $res 100644
77
83
Binary files a/text and b/text differ
78
84
resolved
79
85
80
86
diff --git a/text b/text
81
- index f719efd..2ab19ae 100644
87
+ index $two .. $res 100644
82
88
Binary files a/text and b/text differ
83
89
EOF
84
90
test_expect_success ' diff -m respects binary attribute' '
85
91
git show --format=%s -m >actual &&
86
92
test_cmp expect actual
87
93
'
88
94
89
- cat > expect << ' EOF '
95
+ cat > expect << EOF
90
96
resolved
91
97
92
98
diff --combined text
93
- index 2bdf67a,f719efd..2ab19ae
99
+ index $three , $two .. $res
94
100
Binary files differ
95
101
EOF
96
102
test_expect_success ' diff -c respects binary attribute' '
97
103
git show --format=%s -c >actual &&
98
104
test_cmp expect actual
99
105
'
100
106
101
- cat > expect << ' EOF '
107
+ cat > expect << EOF
102
108
resolved
103
109
104
110
diff --cc text
105
- index 2bdf67a,f719efd..2ab19ae
111
+ index $three , $two .. $res
106
112
Binary files differ
107
113
EOF
108
114
test_expect_success ' diff --cc respects binary attribute' '
@@ -115,11 +121,11 @@ test_expect_success 'setup textconv attribute' '
115
121
git config diff.upcase.textconv "tr a-z A-Z <"
116
122
'
117
123
118
- cat > expect << ' EOF '
124
+ cat > expect << EOF
119
125
resolved
120
126
121
127
diff --git a/text b/text
122
- index 2bdf67a..2ab19ae 100644
128
+ index $three .. $res 100644
123
129
--- a/text
124
130
+++ b/text
125
131
@@ -1 +1 @@
@@ -128,7 +134,7 @@ index 2bdf67a..2ab19ae 100644
128
134
resolved
129
135
130
136
diff --git a/text b/text
131
- index f719efd..2ab19ae 100644
137
+ index $two .. $res 100644
132
138
--- a/text
133
139
+++ b/text
134
140
@@ -1 +1 @@
@@ -140,11 +146,11 @@ test_expect_success 'diff -m respects textconv attribute' '
140
146
test_cmp expect actual
141
147
'
142
148
143
- cat > expect << ' EOF '
149
+ cat > expect << EOF
144
150
resolved
145
151
146
152
diff --combined text
147
- index 2bdf67a,f719efd..2ab19ae
153
+ index $three , $two .. $res
148
154
--- a/text
149
155
+++ b/text
150
156
@@@ -1,1 -1,1 +1,1 @@@
@@ -157,11 +163,11 @@ test_expect_success 'diff -c respects textconv attribute' '
157
163
test_cmp expect actual
158
164
'
159
165
160
- cat > expect << ' EOF '
166
+ cat > expect << EOF
161
167
resolved
162
168
163
169
diff --cc text
164
- index 2bdf67a,f719efd..2ab19ae
170
+ index $three , $two .. $res
165
171
--- a/text
166
172
+++ b/text
167
173
@@@ -1,1 -1,1 +1,1 @@@
@@ -174,9 +180,9 @@ test_expect_success 'diff --cc respects textconv attribute' '
174
180
test_cmp expect actual
175
181
'
176
182
177
- cat > expect << ' EOF '
183
+ cat > expect << EOF
178
184
diff --combined text
179
- index 2bdf67a,f719efd..2ab19ae
185
+ index $three , $two .. $res
180
186
--- a/text
181
187
+++ b/text
182
188
@@@ -1,1 -1,1 +1,1 @@@
@@ -190,9 +196,9 @@ test_expect_success 'diff-tree plumbing does not respect textconv' '
190
196
test_cmp expect actual
191
197
'
192
198
193
- cat > expect << ' EOF '
199
+ cat > expect << EOF
194
200
diff --cc text
195
- index 2bdf67a,f719efd ..0000000
201
+ index $three , $two ..0000000
196
202
--- a/text
197
203
+++ b/text
198
204
@@@ -1,1 -1,1 +1,5 @@@
0 commit comments