t1000: 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 0b8b25f610b60f7a1c5f2608c3a3aaf409013b1b
1 file changed +315 -333
t/t1000-read-tree-m-3way.sh
+315 -333
@@ -128,29 +128,29 @@ cat >expected <<\EOF
128 EOF
129
130 check_result () {
131 - git ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current &&
132 - test_cmp expected current
131 + git ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current &&
132 + test_cmp expected current
133 }
134
135 # This is done on an empty work directory, which is the normal
136 # merge person behaviour.
137 -test_expect_success \
138 - '3-way merge with git read-tree -m, empty cache' \
139 - "rm -fr [NDMALTS][NDMALTSF] Z &&
140 - rm .git/index &&
141 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
142 - check_result"
137 +test_expect_success '3-way merge with git read-tree -m, empty cache' '
138 + rm -fr [NDMALTS][NDMALTSF] Z &&
139 + rm .git/index &&
140 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
141 + check_result
142 +'
143
144 # This starts out with the first head, which is the normal
145 # patch submitter behaviour.
146 -test_expect_success \
147 - '3-way merge with git read-tree -m, match H' \
148 - "rm -fr [NDMALTS][NDMALTSF] Z &&
149 - rm .git/index &&
150 - read_tree_must_succeed $tree_A &&
151 - git checkout-index -f -u -a &&
152 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
153 - check_result"
146 +test_expect_success '3-way merge with git read-tree -m, match H' '
147 + rm -fr [NDMALTS][NDMALTSF] Z &&
148 + rm .git/index &&
149 + read_tree_must_succeed $tree_A &&
150 + git checkout-index -f -u -a &&
151 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
152 + check_result
153 +'
154
155 : <<\END_OF_CASE_TABLE
156
@@ -208,322 +208,304 @@ DF (file) when tree B require DF to be a directory by having DF/DF
208
209 END_OF_CASE_TABLE
210
211 -test_expect_success '1 - must not have an entry not in A.' "
212 - rm -f .git/index XX &&
213 - echo XX >XX &&
214 - git update-index --add XX &&
215 - read_tree_must_fail -m $tree_O $tree_A $tree_B
216 -"
217 -
218 -test_expect_success \
219 - '2 - must match B in !O && !A && B case.' \
220 - "rm -f .git/index NA &&
221 - cp .orig-B/NA NA &&
222 - git update-index --add NA &&
223 - read_tree_must_succeed -m $tree_O $tree_A $tree_B"
224 -
225 -test_expect_success \
226 - '2 - matching B alone is OK in !O && !A && B case.' \
227 - "rm -f .git/index NA &&
228 - cp .orig-B/NA NA &&
229 - git update-index --add NA &&
230 - echo extra >>NA &&
231 - read_tree_must_succeed -m $tree_O $tree_A $tree_B"
232 -
233 -test_expect_success \
234 - '3 - must match A in !O && A && !B case.' \
235 - "rm -f .git/index AN &&
236 - cp .orig-A/AN AN &&
237 - git update-index --add AN &&
238 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
239 - check_result"
240 -
241 -test_expect_success \
242 - '3 - matching A alone is OK in !O && A && !B case.' \
243 - "rm -f .git/index AN &&
244 - cp .orig-A/AN AN &&
245 - git update-index --add AN &&
246 - echo extra >>AN &&
247 - read_tree_must_succeed -m $tree_O $tree_A $tree_B"
248 -
249 -test_expect_success \
250 - '3 (fail) - must match A in !O && A && !B case.' "
251 - rm -f .git/index AN &&
252 - cp .orig-A/AN AN &&
253 - echo extra >>AN &&
254 - git update-index --add AN &&
255 - read_tree_must_fail -m $tree_O $tree_A $tree_B
256 -"
257 -
258 -test_expect_success \
259 - '4 - must match and be up-to-date in !O && A && B && A!=B case.' \
260 - "rm -f .git/index AA &&
261 - cp .orig-A/AA AA &&
262 - git update-index --add AA &&
263 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
264 - check_result"
265 -
266 -test_expect_success \
267 - '4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.' "
268 - rm -f .git/index AA &&
269 - cp .orig-A/AA AA &&
270 - git update-index --add AA &&
271 - echo extra >>AA &&
272 - read_tree_must_fail -m $tree_O $tree_A $tree_B
273 -"
274 -
275 -test_expect_success \
276 - '4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.' "
277 - rm -f .git/index AA &&
278 - cp .orig-A/AA AA &&
279 - echo extra >>AA &&
280 - git update-index --add AA &&
281 - read_tree_must_fail -m $tree_O $tree_A $tree_B
282 -"
283 -
284 -test_expect_success \
285 - '5 - must match in !O && A && B && A==B case.' \
286 - "rm -f .git/index LL &&
287 - cp .orig-A/LL LL &&
288 - git update-index --add LL &&
289 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
290 - check_result"
291 -
292 -test_expect_success \
293 - '5 - must match in !O && A && B && A==B case.' \
294 - "rm -f .git/index LL &&
295 - cp .orig-A/LL LL &&
296 - git update-index --add LL &&
297 - echo extra >>LL &&
298 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
299 - check_result"
300 -
301 -test_expect_success \
302 - '5 (fail) - must match A in !O && A && B && A==B case.' "
303 - rm -f .git/index LL &&
304 - cp .orig-A/LL LL &&
305 - echo extra >>LL &&
306 - git update-index --add LL &&
307 - read_tree_must_fail -m $tree_O $tree_A $tree_B
308 -"
309 -
310 -test_expect_success \
311 - '6 - must not exist in O && !A && !B case' "
312 - rm -f .git/index DD &&
313 - echo DD >DD &&
314 - git update-index --add DD &&
315 - read_tree_must_fail -m $tree_O $tree_A $tree_B
316 -"
317 -
318 -test_expect_success \
319 - '7 - must not exist in O && !A && B && O!=B case' "
320 - rm -f .git/index DM &&
321 - cp .orig-B/DM DM &&
322 - git update-index --add DM &&
323 - read_tree_must_fail -m $tree_O $tree_A $tree_B
324 -"
325 -
326 -test_expect_success \
327 - '8 - must not exist in O && !A && B && O==B case' "
328 - rm -f .git/index DN &&
329 - cp .orig-B/DN DN &&
330 - git update-index --add DN &&
331 - read_tree_must_fail -m $tree_O $tree_A $tree_B
332 -"
333 -
334 -test_expect_success \
335 - '9 - must match and be up-to-date in O && A && !B && O!=A case' \
336 - "rm -f .git/index MD &&
337 - cp .orig-A/MD MD &&
338 - git update-index --add MD &&
339 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
340 - check_result"
341 -
342 -test_expect_success \
343 - '9 (fail) - must match and be up-to-date in O && A && !B && O!=A case' "
344 - rm -f .git/index MD &&
345 - cp .orig-A/MD MD &&
346 - git update-index --add MD &&
347 - echo extra >>MD &&
348 - read_tree_must_fail -m $tree_O $tree_A $tree_B
349 -"
350 -
351 -test_expect_success \
352 - '9 (fail) - must match and be up-to-date in O && A && !B && O!=A case' "
353 - rm -f .git/index MD &&
354 - cp .orig-A/MD MD &&
355 - echo extra >>MD &&
356 - git update-index --add MD &&
357 - read_tree_must_fail -m $tree_O $tree_A $tree_B
358 -"
359 -
360 -test_expect_success \
361 - '10 - must match and be up-to-date in O && A && !B && O==A case' \
362 - "rm -f .git/index ND &&
363 - cp .orig-A/ND ND &&
364 - git update-index --add ND &&
365 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
366 - check_result"
367 -
368 -test_expect_success \
369 - '10 (fail) - must match and be up-to-date in O && A && !B && O==A case' "
370 - rm -f .git/index ND &&
371 - cp .orig-A/ND ND &&
372 - git update-index --add ND &&
373 - echo extra >>ND &&
374 - read_tree_must_fail -m $tree_O $tree_A $tree_B
375 -"
376 -
377 -test_expect_success \
378 - '10 (fail) - must match and be up-to-date in O && A && !B && O==A case' "
379 - rm -f .git/index ND &&
380 - cp .orig-A/ND ND &&
381 - echo extra >>ND &&
382 - git update-index --add ND &&
383 - read_tree_must_fail -m $tree_O $tree_A $tree_B
384 -"
385 -
386 -test_expect_success \
387 - '11 - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case' \
388 - "rm -f .git/index MM &&
389 - cp .orig-A/MM MM &&
390 - git update-index --add MM &&
391 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
392 - check_result"
393 -
394 -test_expect_success \
395 - '11 (fail) - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case' "
396 - rm -f .git/index MM &&
397 - cp .orig-A/MM MM &&
398 - git update-index --add MM &&
399 - echo extra >>MM &&
400 - read_tree_must_fail -m $tree_O $tree_A $tree_B
401 -"
402 -
403 -test_expect_success \
404 - '11 (fail) - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case' "
405 - rm -f .git/index MM &&
406 - cp .orig-A/MM MM &&
407 - echo extra >>MM &&
408 - git update-index --add MM &&
409 - read_tree_must_fail -m $tree_O $tree_A $tree_B
410 -"
411 -
412 -test_expect_success \
413 - '12 - must match A in O && A && B && O!=A && A==B case' \
414 - "rm -f .git/index SS &&
415 - cp .orig-A/SS SS &&
416 - git update-index --add SS &&
417 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
418 - check_result"
419 -
420 -test_expect_success \
421 - '12 - must match A in O && A && B && O!=A && A==B case' \
422 - "rm -f .git/index SS &&
423 - cp .orig-A/SS SS &&
424 - git update-index --add SS &&
425 - echo extra >>SS &&
426 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
427 - check_result"
428 -
429 -test_expect_success \
430 - '12 (fail) - must match A in O && A && B && O!=A && A==B case' "
431 - rm -f .git/index SS &&
432 - cp .orig-A/SS SS &&
433 - echo extra >>SS &&
434 - git update-index --add SS &&
435 - read_tree_must_fail -m $tree_O $tree_A $tree_B
436 -"
437 -
438 -test_expect_success \
439 - '13 - must match A in O && A && B && O!=A && O==B case' \
440 - "rm -f .git/index MN &&
441 - cp .orig-A/MN MN &&
442 - git update-index --add MN &&
443 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
444 - check_result"
445 -
446 -test_expect_success \
447 - '13 - must match A in O && A && B && O!=A && O==B case' \
448 - "rm -f .git/index MN &&
449 - cp .orig-A/MN MN &&
450 - git update-index --add MN &&
451 - echo extra >>MN &&
452 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
453 - check_result"
454 -
455 -test_expect_success \
456 - '14 - must match and be up-to-date in O && A && B && O==A && O!=B case' \
457 - "rm -f .git/index NM &&
458 - cp .orig-A/NM NM &&
459 - git update-index --add NM &&
460 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
461 - check_result"
462 -
463 -test_expect_success \
464 - '14 - may match B in O && A && B && O==A && O!=B case' \
465 - "rm -f .git/index NM &&
466 - cp .orig-B/NM NM &&
467 - git update-index --add NM &&
468 - echo extra >>NM &&
469 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
470 - check_result"
471 -
472 -test_expect_success \
473 - '14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case' "
474 - rm -f .git/index NM &&
475 - cp .orig-A/NM NM &&
476 - git update-index --add NM &&
477 - echo extra >>NM &&
478 - read_tree_must_fail -m $tree_O $tree_A $tree_B
479 -"
480 -
481 -test_expect_success \
482 - '14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case' "
483 - rm -f .git/index NM &&
484 - cp .orig-A/NM NM &&
485 - echo extra >>NM &&
486 - git update-index --add NM &&
487 - read_tree_must_fail -m $tree_O $tree_A $tree_B
488 -"
489 -
490 -test_expect_success \
491 - '15 - must match A in O && A && B && O==A && O==B case' \
492 - "rm -f .git/index NN &&
493 - cp .orig-A/NN NN &&
494 - git update-index --add NN &&
495 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
496 - check_result"
497 -
498 -test_expect_success \
499 - '15 - must match A in O && A && B && O==A && O==B case' \
500 - "rm -f .git/index NN &&
501 - cp .orig-A/NN NN &&
502 - git update-index --add NN &&
503 - echo extra >>NN &&
504 - read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
505 - check_result"
506 -
507 -test_expect_success \
508 - '15 (fail) - must match A in O && A && B && O==A && O==B case' "
509 - rm -f .git/index NN &&
510 - cp .orig-A/NN NN &&
511 - echo extra >>NN &&
512 - git update-index --add NN &&
513 - read_tree_must_fail -m $tree_O $tree_A $tree_B
514 -"
515 -
516 -# #16
517 -test_expect_success \
518 - '16 - A matches in one and B matches in another.' \
519 - 'rm -f .git/index F16 &&
520 - echo F16 >F16 &&
521 - git update-index --add F16 &&
522 - tree0=$(git write-tree) &&
523 - echo E16 >F16 &&
524 - git update-index F16 &&
525 - tree1=$(git write-tree) &&
526 - read_tree_must_succeed -m $tree0 $tree1 $tree1 $tree0 &&
527 - git ls-files --stage'
211 +test_expect_success '1 - must not have an entry not in A.' '
212 + rm -f .git/index XX &&
213 + echo XX >XX &&
214 + git update-index --add XX &&
215 + read_tree_must_fail -m $tree_O $tree_A $tree_B
216 +'
217 +
218 +test_expect_success '2 - must match B in !O && !A && B case.' '
219 + rm -f .git/index NA &&
220 + cp .orig-B/NA NA &&
221 + git update-index --add NA &&
222 + read_tree_must_succeed -m $tree_O $tree_A $tree_B
223 +'
224 +
225 +test_expect_success '2 - matching B alone is OK in !O && !A && B case.' '
226 + rm -f .git/index NA &&
227 + cp .orig-B/NA NA &&
228 + git update-index --add NA &&
229 + echo extra >>NA &&
230 + read_tree_must_succeed -m $tree_O $tree_A $tree_B
231 +'
232 +
233 +test_expect_success '3 - must match A in !O && A && !B case.' '
234 + rm -f .git/index AN &&
235 + cp .orig-A/AN AN &&
236 + git update-index --add AN &&
237 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
238 + check_result
239 +'
240 +
241 +test_expect_success '3 - matching A alone is OK in !O && A && !B case.' '
242 + rm -f .git/index AN &&
243 + cp .orig-A/AN AN &&
244 + git update-index --add AN &&
245 + echo extra >>AN &&
246 + read_tree_must_succeed -m $tree_O $tree_A $tree_B
247 +'
248 +
249 +test_expect_success '3 (fail) - must match A in !O && A && !B case.' '
250 + rm -f .git/index AN &&
251 + cp .orig-A/AN AN &&
252 + echo extra >>AN &&
253 + git update-index --add AN &&
254 + read_tree_must_fail -m $tree_O $tree_A $tree_B
255 +'
256 +
257 +test_expect_success '4 - must match and be up-to-date in !O && A && B && A!=B case.' '
258 + rm -f .git/index AA &&
259 + cp .orig-A/AA AA &&
260 + git update-index --add AA &&
261 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
262 + check_result
263 +'
264 +
265 +test_expect_success '4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.' '
266 + rm -f .git/index AA &&
267 + cp .orig-A/AA AA &&
268 + git update-index --add AA &&
269 + echo extra >>AA &&
270 + read_tree_must_fail -m $tree_O $tree_A $tree_B
271 +'
272 +
273 +test_expect_success '4 (fail) - must match and be up-to-date in !O && A && B && A!=B case.' '
274 + rm -f .git/index AA &&
275 + cp .orig-A/AA AA &&
276 + echo extra >>AA &&
277 + git update-index --add AA &&
278 + read_tree_must_fail -m $tree_O $tree_A $tree_B
279 +'
280 +
281 +test_expect_success '5 - must match in !O && A && B && A==B case.' '
282 + rm -f .git/index LL &&
283 + cp .orig-A/LL LL &&
284 + git update-index --add LL &&
285 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
286 + check_result
287 +'
288 +
289 +test_expect_success '5 - must match in !O && A && B && A==B case.' '
290 + rm -f .git/index LL &&
291 + cp .orig-A/LL LL &&
292 + git update-index --add LL &&
293 + echo extra >>LL &&
294 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
295 + check_result
296 +'
297 +
298 +test_expect_success '5 (fail) - must match A in !O && A && B && A==B case.' '
299 + rm -f .git/index LL &&
300 + cp .orig-A/LL LL &&
301 + echo extra >>LL &&
302 + git update-index --add LL &&
303 + read_tree_must_fail -m $tree_O $tree_A $tree_B
304 +'
305 +
306 +test_expect_success '6 - must not exist in O && !A && !B case' '
307 + rm -f .git/index DD &&
308 + echo DD >DD &&
309 + git update-index --add DD &&
310 + read_tree_must_fail -m $tree_O $tree_A $tree_B
311 +'
312 +
313 +test_expect_success '7 - must not exist in O && !A && B && O!=B case' '
314 + rm -f .git/index DM &&
315 + cp .orig-B/DM DM &&
316 + git update-index --add DM &&
317 + read_tree_must_fail -m $tree_O $tree_A $tree_B
318 +'
319 +
320 +test_expect_success '8 - must not exist in O && !A && B && O==B case' '
321 + rm -f .git/index DN &&
322 + cp .orig-B/DN DN &&
323 + git update-index --add DN &&
324 + read_tree_must_fail -m $tree_O $tree_A $tree_B
325 +'
326 +
327 +test_expect_success '9 - must match and be up-to-date in O && A && !B && O!=A case' '
328 + rm -f .git/index MD &&
329 + cp .orig-A/MD MD &&
330 + git update-index --add MD &&
331 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
332 + check_result
333 +'
334 +
335 +test_expect_success '9 (fail) - must match and be up-to-date in O && A && !B && O!=A case' '
336 + rm -f .git/index MD &&
337 + cp .orig-A/MD MD &&
338 + git update-index --add MD &&
339 + echo extra >>MD &&
340 + read_tree_must_fail -m $tree_O $tree_A $tree_B
341 +'
342 +
343 +test_expect_success '9 (fail) - must match and be up-to-date in O && A && !B && O!=A case' '
344 + rm -f .git/index MD &&
345 + cp .orig-A/MD MD &&
346 + echo extra >>MD &&
347 + git update-index --add MD &&
348 + read_tree_must_fail -m $tree_O $tree_A $tree_B
349 +'
350 +
351 +test_expect_success '10 - must match and be up-to-date in O && A && !B && O==A case' '
352 + rm -f .git/index ND &&
353 + cp .orig-A/ND ND &&
354 + git update-index --add ND &&
355 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
356 + check_result
357 +'
358 +
359 +test_expect_success '10 (fail) - must match and be up-to-date in O && A && !B && O==A case' '
360 + rm -f .git/index ND &&
361 + cp .orig-A/ND ND &&
362 + git update-index --add ND &&
363 + echo extra >>ND &&
364 + read_tree_must_fail -m $tree_O $tree_A $tree_B
365 +'
366 +
367 +test_expect_success '10 (fail) - must match and be up-to-date in O && A && !B && O==A case' '
368 + rm -f .git/index ND &&
369 + cp .orig-A/ND ND &&
370 + echo extra >>ND &&
371 + git update-index --add ND &&
372 + read_tree_must_fail -m $tree_O $tree_A $tree_B
373 +'
374 +
375 +test_expect_success '11 - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case' '
376 + rm -f .git/index MM &&
377 + cp .orig-A/MM MM &&
378 + git update-index --add MM &&
379 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
380 + check_result
381 +'
382 +
383 +test_expect_success '11 (fail) - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case' '
384 + rm -f .git/index MM &&
385 + cp .orig-A/MM MM &&
386 + git update-index --add MM &&
387 + echo extra >>MM &&
388 + read_tree_must_fail -m $tree_O $tree_A $tree_B
389 +'
390 +
391 +test_expect_success '11 (fail) - must match and be up-to-date in O && A && B && O!=A && O!=B && A!=B case' '
392 + rm -f .git/index MM &&
393 + cp .orig-A/MM MM &&
394 + echo extra >>MM &&
395 + git update-index --add MM &&
396 + read_tree_must_fail -m $tree_O $tree_A $tree_B
397 +'
398 +
399 +test_expect_success '12 - must match A in O && A && B && O!=A && A==B case' '
400 + rm -f .git/index SS &&
401 + cp .orig-A/SS SS &&
402 + git update-index --add SS &&
403 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
404 + check_result
405 +'
406 +
407 +test_expect_success '12 - must match A in O && A && B && O!=A && A==B case' '
408 + rm -f .git/index SS &&
409 + cp .orig-A/SS SS &&
410 + git update-index --add SS &&
411 + echo extra >>SS &&
412 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
413 + check_result
414 +'
415 +
416 +test_expect_success '12 (fail) - must match A in O && A && B && O!=A && A==B case' '
417 + rm -f .git/index SS &&
418 + cp .orig-A/SS SS &&
419 + echo extra >>SS &&
420 + git update-index --add SS &&
421 + read_tree_must_fail -m $tree_O $tree_A $tree_B
422 +'
423 +
424 +test_expect_success '13 - must match A in O && A && B && O!=A && O==B case' '
425 + rm -f .git/index MN &&
426 + cp .orig-A/MN MN &&
427 + git update-index --add MN &&
428 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
429 + check_result
430 +'
431 +
432 +test_expect_success '13 - must match A in O && A && B && O!=A && O==B case' '
433 + rm -f .git/index MN &&
434 + cp .orig-A/MN MN &&
435 + git update-index --add MN &&
436 + echo extra >>MN &&
437 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
438 + check_result
439 +'
440 +
441 +test_expect_success '14 - must match and be up-to-date in O && A && B && O==A && O!=B case' '
442 + rm -f .git/index NM &&
443 + cp .orig-A/NM NM &&
444 + git update-index --add NM &&
445 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
446 + check_result
447 +'
448 +
449 +test_expect_success '14 - may match B in O && A && B && O==A && O!=B case' '
450 + rm -f .git/index NM &&
451 + cp .orig-B/NM NM &&
452 + git update-index --add NM &&
453 + echo extra >>NM &&
454 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
455 + check_result
456 +'
457 +
458 +test_expect_success '14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case' '
459 + rm -f .git/index NM &&
460 + cp .orig-A/NM NM &&
461 + git update-index --add NM &&
462 + echo extra >>NM &&
463 + read_tree_must_fail -m $tree_O $tree_A $tree_B
464 +'
465 +
466 +test_expect_success '14 (fail) - must match and be up-to-date in O && A && B && O==A && O!=B case' '
467 + rm -f .git/index NM &&
468 + cp .orig-A/NM NM &&
469 + echo extra >>NM &&
470 + git update-index --add NM &&
471 + read_tree_must_fail -m $tree_O $tree_A $tree_B
472 +'
473 +
474 +test_expect_success '15 - must match A in O && A && B && O==A && O==B case' '
475 + rm -f .git/index NN &&
476 + cp .orig-A/NN NN &&
477 + git update-index --add NN &&
478 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
479 + check_result
480 +'
481 +
482 +test_expect_success '15 - must match A in O && A && B && O==A && O==B case' '
483 + rm -f .git/index NN &&
484 + cp .orig-A/NN NN &&
485 + git update-index --add NN &&
486 + echo extra >>NN &&
487 + read_tree_must_succeed -m $tree_O $tree_A $tree_B &&
488 + check_result
489 +'
490 +
491 +test_expect_success '15 (fail) - must match A in O && A && B && O==A && O==B case' '
492 + rm -f .git/index NN &&
493 + cp .orig-A/NN NN &&
494 + echo extra >>NN &&
495 + git update-index --add NN &&
496 + read_tree_must_fail -m $tree_O $tree_A $tree_B
497 +'
498 +
499 +test_expect_success '16 - A matches in one and B matches in another.' '
500 + rm -f .git/index F16 &&
501 + echo F16 >F16 &&
502 + git update-index --add F16 &&
503 + tree0=$(git write-tree) &&
504 + echo E16 >F16 &&
505 + git update-index F16 &&
506 + tree1=$(git write-tree) &&
507 + read_tree_must_succeed -m $tree0 $tree1 $tree1 $tree0 &&
508 + git ls-files --stage
509 +'
510
511 test_done