t1001: modernize style
The preferred style in tests is: test_expect_success 'short description then sq to open the body' ' here comes the test && and chains over many lines && with closing sq on its own line ' Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller committed
Jan 9, 2017 at 17:45 UTC
83587d5236cbb4f45d6c0c551d0f0669ba25b176
1 file changed
+320
-321
t/t1001-read-tree-m-2way.sh
+320
-321
@@ -14,10 +14,10 @@ all the combinations described in the two-tree merge "carry forward"
14
rules, found in <Documentation/git read-tree.txt>.
15
16
In the test, these paths are used:
17
- bozbar - in H, stays in M, modified from bozbar to gnusto
18
- frotz - not in H added in M
19
- nitfol - in H, stays in M unmodified
20
- rezrov - in H, deleted in M
17
+ bozbar - in H, stays in M, modified from bozbar to gnusto
18
+ frotz - not in H added in M
19
+ nitfol - in H, stays in M unmodified
20
+ rezrov - in H, deleted in M
21
yomin - not in H or M
22
'
23
. ./test-lib.sh
@@ -60,336 +60,335 @@ EOF
60
61
sed -e 's/bozbar/gnusto (earlier bozbar)/' bozbar-old >bozbar-new
62
63
-test_expect_success \
64
- setup \
65
- 'echo frotz >frotz &&
66
- echo nitfol >nitfol &&
67
- cat bozbar-old >bozbar &&
68
- echo rezrov >rezrov &&
69
- echo yomin >yomin &&
70
- git update-index --add nitfol bozbar rezrov &&
71
- treeH=$(git write-tree) &&
72
- echo treeH $treeH &&
73
- git ls-tree $treeH &&
74
-
75
- cat bozbar-new >bozbar &&
76
- git update-index --add frotz bozbar --force-remove rezrov &&
77
- git ls-files --stage >M.out &&
78
- treeM=$(git write-tree) &&
79
- echo treeM $treeM &&
80
- git ls-tree $treeM &&
81
- git diff-tree $treeH $treeM'
82
-
83
-test_expect_success \
84
- '1, 2, 3 - no carry forward' \
85
- 'rm -f .git/index &&
86
- read_tree_twoway $treeH $treeM &&
87
- git ls-files --stage >1-3.out &&
88
- test_cmp M.out 1-3.out &&
89
- check_cache_at bozbar dirty &&
90
- check_cache_at frotz dirty &&
91
- check_cache_at nitfol dirty'
63
+test_expect_success 'setup' '
64
+ echo frotz >frotz &&
65
+ echo nitfol >nitfol &&
66
+ cat bozbar-old >bozbar &&
67
+ echo rezrov >rezrov &&
68
+ echo yomin >yomin &&
69
+ git update-index --add nitfol bozbar rezrov &&
70
+ treeH=$(git write-tree) &&
71
+ echo treeH $treeH &&
72
+ git ls-tree $treeH &&
73
+
74
+ cat bozbar-new >bozbar &&
75
+ git update-index --add frotz bozbar --force-remove rezrov &&
76
+ git ls-files --stage >M.out &&
77
+ treeM=$(git write-tree) &&
78
+ echo treeM $treeM &&
79
+ git ls-tree $treeM &&
80
+ git diff-tree $treeH $treeM
81
+'
82
83
+test_expect_success '1, 2, 3 - no carry forward' '
84
+ rm -f .git/index &&
85
+ read_tree_twoway $treeH $treeM &&
86
+ git ls-files --stage >1-3.out &&
87
+ test_cmp M.out 1-3.out &&
88
+ check_cache_at bozbar dirty &&
89
+ check_cache_at frotz dirty &&
90
+ check_cache_at nitfol dirty
91
+'
92
echo '+100644 X 0 yomin' >expected
93
95
-test_expect_success \
96
- '4 - carry forward local addition.' \
97
- 'rm -f .git/index &&
98
- read_tree_must_succeed $treeH &&
99
- git checkout-index -u -f -q -a &&
100
- git update-index --add yomin &&
101
- read_tree_twoway $treeH $treeM &&
102
- git ls-files --stage >4.out &&
103
- test_must_fail git diff --no-index M.out 4.out >4diff.out &&
104
- compare_change 4diff.out expected &&
105
- check_cache_at yomin clean'
106
-
107
-test_expect_success \
108
- '5 - carry forward local addition.' \
109
- 'rm -f .git/index &&
110
- read_tree_must_succeed $treeH &&
111
- git checkout-index -u -f -q -a &&
112
- echo yomin >yomin &&
113
- git update-index --add yomin &&
114
- echo yomin yomin >yomin &&
115
- read_tree_twoway $treeH $treeM &&
116
- git ls-files --stage >5.out &&
117
- test_must_fail git diff --no-index M.out 5.out >5diff.out &&
118
- compare_change 5diff.out expected &&
119
- check_cache_at yomin dirty'
120
-
121
-test_expect_success \
122
- '6 - local addition already has the same.' \
123
- 'rm -f .git/index &&
124
- read_tree_must_succeed $treeH &&
125
- git checkout-index -u -f -q -a &&
126
- git update-index --add frotz &&
127
- read_tree_twoway $treeH $treeM &&
128
- git ls-files --stage >6.out &&
129
- test_cmp M.out 6.out &&
130
- check_cache_at frotz clean'
131
-
132
-test_expect_success \
133
- '7 - local addition already has the same.' \
134
- 'rm -f .git/index &&
135
- read_tree_must_succeed $treeH &&
136
- git checkout-index -u -f -q -a &&
137
- echo frotz >frotz &&
138
- git update-index --add frotz &&
139
- echo frotz frotz >frotz &&
140
- read_tree_twoway $treeH $treeM &&
141
- git ls-files --stage >7.out &&
142
- test_cmp M.out 7.out &&
143
- check_cache_at frotz dirty'
144
-
145
-test_expect_success \
146
- '8 - conflicting addition.' \
147
- 'rm -f .git/index &&
148
- read_tree_must_succeed $treeH &&
149
- git checkout-index -u -f -q -a &&
150
- echo frotz frotz >frotz &&
151
- git update-index --add frotz &&
152
- if read_tree_twoway $treeH $treeM; then false; else :; fi'
153
-
154
-test_expect_success \
155
- '9 - conflicting addition.' \
156
- 'rm -f .git/index &&
157
- read_tree_must_succeed $treeH &&
158
- git checkout-index -u -f -q -a &&
159
- echo frotz frotz >frotz &&
160
- git update-index --add frotz &&
161
- echo frotz >frotz &&
162
- if read_tree_twoway $treeH $treeM; then false; else :; fi'
163
-
164
-test_expect_success \
165
- '10 - path removed.' \
166
- 'rm -f .git/index &&
167
- read_tree_must_succeed $treeH &&
168
- git checkout-index -u -f -q -a &&
169
- echo rezrov >rezrov &&
170
- git update-index --add rezrov &&
171
- read_tree_twoway $treeH $treeM &&
172
- git ls-files --stage >10.out &&
173
- test_cmp M.out 10.out'
174
-
175
-test_expect_success \
176
- '11 - dirty path removed.' \
177
- 'rm -f .git/index &&
178
- read_tree_must_succeed $treeH &&
179
- git checkout-index -u -f -q -a &&
180
- echo rezrov >rezrov &&
181
- git update-index --add rezrov &&
182
- echo rezrov rezrov >rezrov &&
183
- if read_tree_twoway $treeH $treeM; then false; else :; fi'
184
-
185
-test_expect_success \
186
- '12 - unmatching local changes being removed.' \
187
- 'rm -f .git/index &&
188
- read_tree_must_succeed $treeH &&
189
- git checkout-index -u -f -q -a &&
190
- echo rezrov rezrov >rezrov &&
191
- git update-index --add rezrov &&
192
- if read_tree_twoway $treeH $treeM; then false; else :; fi'
193
-
194
-test_expect_success \
195
- '13 - unmatching local changes being removed.' \
196
- 'rm -f .git/index &&
197
- read_tree_must_succeed $treeH &&
198
- git checkout-index -u -f -q -a &&
199
- echo rezrov rezrov >rezrov &&
200
- git update-index --add rezrov &&
201
- echo rezrov >rezrov &&
202
- if read_tree_twoway $treeH $treeM; then false; else :; fi'
94
+test_expect_success '4 - carry forward local addition.' '
95
+ rm -f .git/index &&
96
+ read_tree_must_succeed $treeH &&
97
+ git checkout-index -u -f -q -a &&
98
+ git update-index --add yomin &&
99
+ read_tree_twoway $treeH $treeM &&
100
+ git ls-files --stage >4.out &&
101
+ test_must_fail git diff --no-index M.out 4.out >4diff.out &&
102
+ compare_change 4diff.out expected &&
103
+ check_cache_at yomin clean
104
+'
105
+
106
+test_expect_success '5 - carry forward local addition.' '
107
+ rm -f .git/index &&
108
+ read_tree_must_succeed $treeH &&
109
+ git checkout-index -u -f -q -a &&
110
+ echo yomin >yomin &&
111
+ git update-index --add yomin &&
112
+ echo yomin yomin >yomin &&
113
+ read_tree_twoway $treeH $treeM &&
114
+ git ls-files --stage >5.out &&
115
+ test_must_fail git diff --no-index M.out 5.out >5diff.out &&
116
+ compare_change 5diff.out expected &&
117
+ check_cache_at yomin dirty
118
+'
119
+
120
+test_expect_success '6 - local addition already has the same.' '
121
+ rm -f .git/index &&
122
+ read_tree_must_succeed $treeH &&
123
+ git checkout-index -u -f -q -a &&
124
+ git update-index --add frotz &&
125
+ read_tree_twoway $treeH $treeM &&
126
+ git ls-files --stage >6.out &&
127
+ test_cmp M.out 6.out &&
128
+ check_cache_at frotz clean
129
+'
130
+
131
+test_expect_success '7 - local addition already has the same.' '
132
+ rm -f .git/index &&
133
+ read_tree_must_succeed $treeH &&
134
+ git checkout-index -u -f -q -a &&
135
+ echo frotz >frotz &&
136
+ git update-index --add frotz &&
137
+ echo frotz frotz >frotz &&
138
+ read_tree_twoway $treeH $treeM &&
139
+ git ls-files --stage >7.out &&
140
+ test_cmp M.out 7.out &&
141
+ check_cache_at frotz dirty
142
+'
143
+
144
+test_expect_success '8 - conflicting addition.' '
145
+ rm -f .git/index &&
146
+ read_tree_must_succeed $treeH &&
147
+ git checkout-index -u -f -q -a &&
148
+ echo frotz frotz >frotz &&
149
+ git update-index --add frotz &&
150
+ if read_tree_twoway $treeH $treeM; then false; else :; fi
151
+'
152
+
153
+test_expect_success '9 - conflicting addition.' '
154
+ rm -f .git/index &&
155
+ read_tree_must_succeed $treeH &&
156
+ git checkout-index -u -f -q -a &&
157
+ echo frotz frotz >frotz &&
158
+ git update-index --add frotz &&
159
+ echo frotz >frotz &&
160
+ if read_tree_twoway $treeH $treeM; then false; else :; fi
161
+'
162
+
163
+test_expect_success '10 - path removed.' '
164
+ rm -f .git/index &&
165
+ read_tree_must_succeed $treeH &&
166
+ git checkout-index -u -f -q -a &&
167
+ echo rezrov >rezrov &&
168
+ git update-index --add rezrov &&
169
+ read_tree_twoway $treeH $treeM &&
170
+ git ls-files --stage >10.out &&
171
+ test_cmp M.out 10.out
172
+'
173
+
174
+test_expect_success '11 - dirty path removed.' '
175
+ rm -f .git/index &&
176
+ read_tree_must_succeed $treeH &&
177
+ git checkout-index -u -f -q -a &&
178
+ echo rezrov >rezrov &&
179
+ git update-index --add rezrov &&
180
+ echo rezrov rezrov >rezrov &&
181
+ if read_tree_twoway $treeH $treeM; then false; else :; fi
182
+'
183
+
184
+test_expect_success '12 - unmatching local changes being removed.' '
185
+ rm -f .git/index &&
186
+ read_tree_must_succeed $treeH &&
187
+ git checkout-index -u -f -q -a &&
188
+ echo rezrov rezrov >rezrov &&
189
+ git update-index --add rezrov &&
190
+ if read_tree_twoway $treeH $treeM; then false; else :; fi
191
+'
192
+
193
+test_expect_success '13 - unmatching local changes being removed.' '
194
+ rm -f .git/index &&
195
+ read_tree_must_succeed $treeH &&
196
+ git checkout-index -u -f -q -a &&
197
+ echo rezrov rezrov >rezrov &&
198
+ git update-index --add rezrov &&
199
+ echo rezrov >rezrov &&
200
+ if read_tree_twoway $treeH $treeM; then false; else :; fi
201
+'
202
203
cat >expected <<EOF
204
-100644 X 0 nitfol
205
+100644 X 0 nitfol
206
EOF
207
209
-test_expect_success \
210
- '14 - unchanged in two heads.' \
211
- 'rm -f .git/index &&
212
- read_tree_must_succeed $treeH &&
213
- git checkout-index -u -f -q -a &&
214
- echo nitfol nitfol >nitfol &&
215
- git update-index --add nitfol &&
216
- read_tree_twoway $treeH $treeM &&
217
- git ls-files --stage >14.out &&
218
- test_must_fail git diff --no-index M.out 14.out >14diff.out &&
219
- compare_change 14diff.out expected &&
220
- check_cache_at nitfol clean'
221
-
222
-test_expect_success \
223
- '15 - unchanged in two heads.' \
224
- 'rm -f .git/index &&
225
- read_tree_must_succeed $treeH &&
226
- git checkout-index -u -f -q -a &&
227
- echo nitfol nitfol >nitfol &&
228
- git update-index --add nitfol &&
229
- echo nitfol nitfol nitfol >nitfol &&
230
- read_tree_twoway $treeH $treeM &&
231
- git ls-files --stage >15.out &&
232
- test_must_fail git diff --no-index M.out 15.out >15diff.out &&
233
- compare_change 15diff.out expected &&
234
- check_cache_at nitfol dirty'
235
-
236
-test_expect_success \
237
- '16 - conflicting local change.' \
238
- 'rm -f .git/index &&
239
- read_tree_must_succeed $treeH &&
240
- git checkout-index -u -f -q -a &&
241
- echo bozbar bozbar >bozbar &&
242
- git update-index --add bozbar &&
243
- if read_tree_twoway $treeH $treeM; then false; else :; fi'
244
-
245
-test_expect_success \
246
- '17 - conflicting local change.' \
247
- 'rm -f .git/index &&
248
- read_tree_must_succeed $treeH &&
249
- git checkout-index -u -f -q -a &&
250
- echo bozbar bozbar >bozbar &&
251
- git update-index --add bozbar &&
252
- echo bozbar bozbar bozbar >bozbar &&
253
- if read_tree_twoway $treeH $treeM; then false; else :; fi'
254
-
255
-test_expect_success \
256
- '18 - local change already having a good result.' \
257
- 'rm -f .git/index &&
258
- read_tree_must_succeed $treeH &&
259
- git checkout-index -u -f -q -a &&
260
- cat bozbar-new >bozbar &&
261
- git update-index --add bozbar &&
262
- read_tree_twoway $treeH $treeM &&
263
- git ls-files --stage >18.out &&
264
- test_cmp M.out 18.out &&
265
- check_cache_at bozbar clean'
266
-
267
-test_expect_success \
268
- '19 - local change already having a good result, further modified.' \
269
- 'rm -f .git/index &&
270
- read_tree_must_succeed $treeH &&
271
- git checkout-index -u -f -q -a &&
272
- cat bozbar-new >bozbar &&
273
- git update-index --add bozbar &&
274
- echo gnusto gnusto >bozbar &&
275
- read_tree_twoway $treeH $treeM &&
276
- git ls-files --stage >19.out &&
277
- test_cmp M.out 19.out &&
278
- check_cache_at bozbar dirty'
279
-
280
-test_expect_success \
281
- '20 - no local change, use new tree.' \
282
- 'rm -f .git/index &&
283
- read_tree_must_succeed $treeH &&
284
- git checkout-index -u -f -q -a &&
285
- cat bozbar-old >bozbar &&
286
- git update-index --add bozbar &&
287
- read_tree_twoway $treeH $treeM &&
288
- git ls-files --stage >20.out &&
289
- test_cmp M.out 20.out &&
290
- check_cache_at bozbar dirty'
291
-
292
-test_expect_success \
293
- '21 - no local change, dirty cache.' \
294
- 'rm -f .git/index &&
295
- read_tree_must_succeed $treeH &&
296
- git checkout-index -u -f -q -a &&
297
- cat bozbar-old >bozbar &&
298
- git update-index --add bozbar &&
299
- echo gnusto gnusto >bozbar &&
300
- if read_tree_twoway $treeH $treeM; then false; else :; fi'
208
+test_expect_success '14 - unchanged in two heads.' '
209
+ rm -f .git/index &&
210
+ read_tree_must_succeed $treeH &&
211
+ git checkout-index -u -f -q -a &&
212
+ echo nitfol nitfol >nitfol &&
213
+ git update-index --add nitfol &&
214
+ read_tree_twoway $treeH $treeM &&
215
+ git ls-files --stage >14.out &&
216
+ test_must_fail git diff --no-index M.out 14.out >14diff.out &&
217
+ compare_change 14diff.out expected &&
218
+ check_cache_at nitfol clean
219
+'
220
+
221
+test_expect_success '15 - unchanged in two heads.' '
222
+ rm -f .git/index &&
223
+ read_tree_must_succeed $treeH &&
224
+ git checkout-index -u -f -q -a &&
225
+ echo nitfol nitfol >nitfol &&
226
+ git update-index --add nitfol &&
227
+ echo nitfol nitfol nitfol >nitfol &&
228
+ read_tree_twoway $treeH $treeM &&
229
+ git ls-files --stage >15.out &&
230
+ test_must_fail git diff --no-index M.out 15.out >15diff.out &&
231
+ compare_change 15diff.out expected &&
232
+ check_cache_at nitfol dirty
233
+'
234
+
235
+test_expect_success '16 - conflicting local change.' '
236
+ rm -f .git/index &&
237
+ read_tree_must_succeed $treeH &&
238
+ git checkout-index -u -f -q -a &&
239
+ echo bozbar bozbar >bozbar &&
240
+ git update-index --add bozbar &&
241
+ if read_tree_twoway $treeH $treeM; then false; else :; fi
242
+'
243
+
244
+test_expect_success '17 - conflicting local change.' '
245
+ rm -f .git/index &&
246
+ read_tree_must_succeed $treeH &&
247
+ git checkout-index -u -f -q -a &&
248
+ echo bozbar bozbar >bozbar &&
249
+ git update-index --add bozbar &&
250
+ echo bozbar bozbar bozbar >bozbar &&
251
+ if read_tree_twoway $treeH $treeM; then false; else :; fi
252
+'
253
+
254
+test_expect_success '18 - local change already having a good result.' '
255
+ rm -f .git/index &&
256
+ read_tree_must_succeed $treeH &&
257
+ git checkout-index -u -f -q -a &&
258
+ cat bozbar-new >bozbar &&
259
+ git update-index --add bozbar &&
260
+ read_tree_twoway $treeH $treeM &&
261
+ git ls-files --stage >18.out &&
262
+ test_cmp M.out 18.out &&
263
+ check_cache_at bozbar clean
264
+'
265
+
266
+test_expect_success '19 - local change already having a good result, further modified.' '
267
+ rm -f .git/index &&
268
+ read_tree_must_succeed $treeH &&
269
+ git checkout-index -u -f -q -a &&
270
+ cat bozbar-new >bozbar &&
271
+ git update-index --add bozbar &&
272
+ echo gnusto gnusto >bozbar &&
273
+ read_tree_twoway $treeH $treeM &&
274
+ git ls-files --stage >19.out &&
275
+ test_cmp M.out 19.out &&
276
+ check_cache_at bozbar dirty
277
+'
278
+
279
+test_expect_success '20 - no local change, use new tree.' '
280
+ rm -f .git/index &&
281
+ read_tree_must_succeed $treeH &&
282
+ git checkout-index -u -f -q -a &&
283
+ cat bozbar-old >bozbar &&
284
+ git update-index --add bozbar &&
285
+ read_tree_twoway $treeH $treeM &&
286
+ git ls-files --stage >20.out &&
287
+ test_cmp M.out 20.out &&
288
+ check_cache_at bozbar dirty
289
+'
290
+
291
+test_expect_success '21 - no local change, dirty cache.' '
292
+ rm -f .git/index &&
293
+ read_tree_must_succeed $treeH &&
294
+ git checkout-index -u -f -q -a &&
295
+ cat bozbar-old >bozbar &&
296
+ git update-index --add bozbar &&
297
+ echo gnusto gnusto >bozbar &&
298
+ if read_tree_twoway $treeH $treeM; then false; else :; fi
299
+'
300
301
# This fails with straight two-way fast-forward.
303
-test_expect_success \
304
- '22 - local change cache updated.' \
305
- 'rm -f .git/index &&
306
- read_tree_must_succeed $treeH &&
307
- git checkout-index -u -f -q -a &&
308
- sed -e "s/such as/SUCH AS/" bozbar-old >bozbar &&
309
- git update-index --add bozbar &&
310
- if read_tree_twoway $treeH $treeM; then false; else :; fi'
302
+test_expect_success '22 - local change cache updated.' '
303
+ rm -f .git/index &&
304
+ read_tree_must_succeed $treeH &&
305
+ git checkout-index -u -f -q -a &&
306
+ sed -e "s/such as/SUCH AS/" bozbar-old >bozbar &&
307
+ git update-index --add bozbar &&
308
+ if read_tree_twoway $treeH $treeM; then false; else :; fi
309
+'
310
311
# Also make sure we did not break DF vs DF/DF case.
313
-test_expect_success \
314
- 'DF vs DF/DF case setup.' \
315
- 'rm -f .git/index &&
316
- echo DF >DF &&
317
- git update-index --add DF &&
318
- treeDF=$(git write-tree) &&
319
- echo treeDF $treeDF &&
320
- git ls-tree $treeDF &&
321
-
322
- rm -f DF &&
323
- mkdir DF &&
324
- echo DF/DF >DF/DF &&
325
- git update-index --add --remove DF DF/DF &&
326
- treeDFDF=$(git write-tree) &&
327
- echo treeDFDF $treeDFDF &&
328
- git ls-tree $treeDFDF &&
329
- git ls-files --stage >DFDF.out'
330
-
331
-test_expect_success \
332
- 'DF vs DF/DF case test.' \
333
- 'rm -f .git/index &&
334
- rm -fr DF &&
335
- echo DF >DF &&
336
- git update-index --add DF &&
337
- read_tree_twoway $treeDF $treeDFDF &&
338
- git ls-files --stage >DFDFcheck.out &&
339
- test_cmp DFDF.out DFDFcheck.out &&
340
- check_cache_at DF/DF dirty &&
341
- :'
342
-
343
-test_expect_success \
344
- 'a/b (untracked) vs a case setup.' \
345
- 'rm -f .git/index &&
346
- : >a &&
347
- git update-index --add a &&
348
- treeM=$(git write-tree) &&
349
- echo treeM $treeM &&
350
- git ls-tree $treeM &&
351
- git ls-files --stage >treeM.out &&
352
-
353
- rm -f a &&
354
- git update-index --remove a &&
355
- mkdir a &&
356
- : >a/b &&
357
- treeH=$(git write-tree) &&
358
- echo treeH $treeH &&
359
- git ls-tree $treeH'
360
-
361
-test_expect_success \
362
- 'a/b (untracked) vs a, plus c/d case test.' \
363
- 'read_tree_u_must_fail -u -m "$treeH" "$treeM" &&
364
- git ls-files --stage &&
365
- test -f a/b'
366
-
367
-test_expect_success \
368
- 'a/b vs a, plus c/d case setup.' \
369
- 'rm -f .git/index &&
370
- rm -fr a &&
371
- : >a &&
372
- mkdir c &&
373
- : >c/d &&
374
- git update-index --add a c/d &&
375
- treeM=$(git write-tree) &&
376
- echo treeM $treeM &&
377
- git ls-tree $treeM &&
378
- git ls-files --stage >treeM.out &&
379
-
380
- rm -f a &&
381
- mkdir a &&
382
- : >a/b &&
383
- git update-index --add --remove a a/b &&
384
- treeH=$(git write-tree) &&
385
- echo treeH $treeH &&
386
- git ls-tree $treeH'
387
-
388
-test_expect_success \
389
- 'a/b vs a, plus c/d case test.' \
390
- 'read_tree_u_must_succeed -u -m "$treeH" "$treeM" &&
391
- git ls-files --stage | tee >treeMcheck.out &&
392
- test_cmp treeM.out treeMcheck.out'
312
+test_expect_success 'DF vs DF/DF case setup.' '
313
+ rm -f .git/index &&
314
+ echo DF >DF &&
315
+ git update-index --add DF &&
316
+ treeDF=$(git write-tree) &&
317
+ echo treeDF $treeDF &&
318
+ git ls-tree $treeDF &&
319
+
320
+ rm -f DF &&
321
+ mkdir DF &&
322
+ echo DF/DF >DF/DF &&
323
+ git update-index --add --remove DF DF/DF &&
324
+ treeDFDF=$(git write-tree) &&
325
+ echo treeDFDF $treeDFDF &&
326
+ git ls-tree $treeDFDF &&
327
+ git ls-files --stage >DFDF.out
328
+'
329
+
330
+test_expect_success 'DF vs DF/DF case test.' '
331
+ rm -f .git/index &&
332
+ rm -fr DF &&
333
+ echo DF >DF &&
334
+ git update-index --add DF &&
335
+ read_tree_twoway $treeDF $treeDFDF &&
336
+ git ls-files --stage >DFDFcheck.out &&
337
+ test_cmp DFDF.out DFDFcheck.out &&
338
+ check_cache_at DF/DF dirty &&
339
+ :
340
+'
341
+
342
+test_expect_success 'a/b (untracked) vs a case setup.' '
343
+ rm -f .git/index &&
344
+ : >a &&
345
+ git update-index --add a &&
346
+ treeM=$(git write-tree) &&
347
+ echo treeM $treeM &&
348
+ git ls-tree $treeM &&
349
+ git ls-files --stage >treeM.out &&
350
+
351
+ rm -f a &&
352
+ git update-index --remove a &&
353
+ mkdir a &&
354
+ : >a/b &&
355
+ treeH=$(git write-tree) &&
356
+ echo treeH $treeH &&
357
+ git ls-tree $treeH
358
+'
359
+
360
+test_expect_success 'a/b (untracked) vs a, plus c/d case test.' '
361
+ read_tree_u_must_fail -u -m "$treeH" "$treeM" &&
362
+ git ls-files --stage &&
363
+ test -f a/b
364
+'
365
+
366
+test_expect_success 'a/b vs a, plus c/d case setup.' '
367
+ rm -f .git/index &&
368
+ rm -fr a &&
369
+ : >a &&
370
+ mkdir c &&
371
+ : >c/d &&
372
+ git update-index --add a c/d &&
373
+ treeM=$(git write-tree) &&
374
+ echo treeM $treeM &&
375
+ git ls-tree $treeM &&
376
+ git ls-files --stage >treeM.out &&
377
+
378
+ rm -f a &&
379
+ mkdir a &&
380
+ : >a/b &&
381
+ git update-index --add --remove a a/b &&
382
+ treeH=$(git write-tree) &&
383
+ echo treeH $treeH &&
384
+ git ls-tree $treeH
385
+'
386
+
387
+test_expect_success 'a/b vs a, plus c/d case test.' '
388
+ read_tree_u_must_succeed -u -m "$treeH" "$treeM" &&
389
+ git ls-files --stage | tee >treeMcheck.out &&
390
+ test_cmp treeM.out treeMcheck.out
391
+'
392
393
test_expect_success '-m references the correct modified tree' '
394
echo >file-a &&