@@ -320,7 +320,12 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' '
320
320
321
321
test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
322
322
test_i18ngrep "Auto-merging dir" output &&
323
- test_i18ngrep "Adding as dir~HEAD instead" output &&
323
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
324
+ then
325
+ test_i18ngrep "moving it to dir~HEAD instead" output
326
+ else
327
+ test_i18ngrep "Adding as dir~HEAD instead" output
328
+ fi &&
324
329
325
330
test 3 -eq "$(git ls-files -u | wc -l)" &&
326
331
test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
@@ -342,7 +347,12 @@ test_expect_success 'Same as previous, but merged other way' '
342
347
! grep "error: refusing to lose untracked file at" errors &&
343
348
test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
344
349
test_i18ngrep "Auto-merging dir" output &&
345
- test_i18ngrep "Adding as dir~renamed-file-has-no-conflicts instead" output &&
350
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
351
+ then
352
+ test_i18ngrep "moving it to dir~renamed-file-has-no-conflicts instead" output
353
+ else
354
+ test_i18ngrep "Adding as dir~renamed-file-has-no-conflicts instead" output
355
+ fi &&
346
356
347
357
test 3 -eq "$(git ls-files -u | wc -l)" &&
348
358
test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
@@ -397,7 +407,12 @@ test_expect_success 'Rename+D/F conflict; renamed file cannot merge and dir in t
397
407
test_must_fail git merge --strategy=recursive dir-in-way &&
398
408
399
409
test 5 -eq "$(git ls-files -u | wc -l)" &&
400
- test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)" &&
410
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
411
+ then
412
+ test 3 -eq "$(git ls-files -u dir~HEAD | wc -l)"
413
+ else
414
+ test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)"
415
+ fi &&
401
416
test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
402
417
403
418
test_must_fail git diff --quiet &&
@@ -415,7 +430,12 @@ test_expect_success 'Same as previous, but merged other way' '
415
430
test_must_fail git merge --strategy=recursive renamed-file-has-conflicts &&
416
431
417
432
test 5 -eq "$(git ls-files -u | wc -l)" &&
418
- test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)" &&
433
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
434
+ then
435
+ test 3 -eq "$(git ls-files -u dir~renamed-file-has-conflicts | wc -l)"
436
+ else
437
+ test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)"
438
+ fi &&
419
439
test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
420
440
421
441
test_must_fail git diff --quiet &&
@@ -471,7 +491,12 @@ test_expect_success 'both rename source and destination involved in D/F conflict
471
491
git checkout -q rename-dest^0 &&
472
492
test_must_fail git merge --strategy=recursive source-conflict &&
473
493
474
- test 1 -eq "$(git ls-files -u | wc -l)" &&
494
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
495
+ then
496
+ test 2 -eq "$(git ls-files -u | wc -l)"
497
+ else
498
+ test 1 -eq "$(git ls-files -u | wc -l)"
499
+ fi &&
475
500
476
501
test_must_fail git diff --quiet &&
477
502
@@ -505,34 +530,63 @@ test_expect_success 'setup pair rename to parent of other (D/F conflicts)' '
505
530
git commit -m "Rename one/file -> two"
506
531
'
507
532
508
- test_expect_success ' pair rename to parent of other (D/F conflicts) w/ untracked dir' '
509
- git checkout -q rename-one^0 &&
510
- mkdir one &&
511
- test_must_fail git merge --strategy=recursive rename-two &&
533
+ if test " $GIT_TEST_MERGE_ALGORITHM " = ort
534
+ then
535
+ test_expect_success ' pair rename to parent of other (D/F conflicts) w/ untracked dir' '
536
+ git checkout -q rename-one^0 &&
537
+ mkdir one &&
538
+ test_must_fail git merge --strategy=recursive rename-two &&
512
539
513
- test 2 -eq "$(git ls-files -u | wc -l)" &&
514
- test 1 -eq "$(git ls-files -u one | wc -l)" &&
515
- test 1 -eq "$(git ls-files -u two | wc -l)" &&
540
+ test 4 -eq "$(git ls-files -u | wc -l)" &&
541
+ test 2 -eq "$(git ls-files -u one | wc -l)" &&
542
+ test 2 -eq "$(git ls-files -u two | wc -l)" &&
516
543
517
- test_must_fail git diff --quiet &&
544
+ test_must_fail git diff --quiet &&
518
545
519
- test 4 -eq $(find . | grep -v .git | wc -l) &&
546
+ test 3 -eq $(find . | grep -v .git | wc -l) &&
520
547
521
- test_path_is_dir one &&
522
- test_path_is_file one~rename-two &&
523
- test_path_is_file two &&
524
- test "other" = $(cat one~rename-two) &&
525
- test "stuff" = $(cat two)
526
- '
548
+ test_path_is_file one &&
549
+ test_path_is_file two &&
550
+ test "other" = $(cat one) &&
551
+ test "stuff" = $(cat two)
552
+ '
553
+ else
554
+ test_expect_success ' pair rename to parent of other (D/F conflicts) w/ untracked dir' '
555
+ git checkout -q rename-one^0 &&
556
+ mkdir one &&
557
+ test_must_fail git merge --strategy=recursive rename-two &&
558
+
559
+ test 2 -eq "$(git ls-files -u | wc -l)" &&
560
+ test 1 -eq "$(git ls-files -u one | wc -l)" &&
561
+ test 1 -eq "$(git ls-files -u two | wc -l)" &&
562
+
563
+ test_must_fail git diff --quiet &&
564
+
565
+ test 4 -eq $(find . | grep -v .git | wc -l) &&
566
+
567
+ test_path_is_dir one &&
568
+ test_path_is_file one~rename-two &&
569
+ test_path_is_file two &&
570
+ test "other" = $(cat one~rename-two) &&
571
+ test "stuff" = $(cat two)
572
+ '
573
+ fi
527
574
528
575
test_expect_success ' pair rename to parent of other (D/F conflicts) w/ clean start' '
529
576
git reset --hard &&
530
577
git clean -fdqx &&
531
578
test_must_fail git merge --strategy=recursive rename-two &&
532
579
533
- test 2 -eq "$(git ls-files -u | wc -l)" &&
534
- test 1 -eq "$(git ls-files -u one | wc -l)" &&
535
- test 1 -eq "$(git ls-files -u two | wc -l)" &&
580
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
581
+ then
582
+ test 4 -eq "$(git ls-files -u | wc -l)" &&
583
+ test 2 -eq "$(git ls-files -u one | wc -l)" &&
584
+ test 2 -eq "$(git ls-files -u two | wc -l)"
585
+ else
586
+ test 2 -eq "$(git ls-files -u | wc -l)" &&
587
+ test 1 -eq "$(git ls-files -u one | wc -l)" &&
588
+ test 1 -eq "$(git ls-files -u two | wc -l)"
589
+ fi &&
536
590
537
591
test_must_fail git diff --quiet &&
538
592
@@ -572,12 +626,22 @@ test_expect_success 'check handling of differently renamed file with D/F conflic
572
626
git checkout -q first-rename^0 &&
573
627
test_must_fail git merge --strategy=recursive second-rename &&
574
628
575
- test 5 -eq "$(git ls-files -s | wc -l)" &&
576
- test 3 -eq "$(git ls-files -u | wc -l)" &&
577
- test 1 -eq "$(git ls-files -u one | wc -l)" &&
578
- test 1 -eq "$(git ls-files -u two | wc -l)" &&
579
- test 1 -eq "$(git ls-files -u original | wc -l)" &&
580
- test 2 -eq "$(git ls-files -o | wc -l)" &&
629
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
630
+ then
631
+ test 5 -eq "$(git ls-files -s | wc -l)" &&
632
+ test 3 -eq "$(git ls-files -u | wc -l)" &&
633
+ test 1 -eq "$(git ls-files -u one~HEAD | wc -l)" &&
634
+ test 1 -eq "$(git ls-files -u two~second-rename | wc -l)" &&
635
+ test 1 -eq "$(git ls-files -u original | wc -l)" &&
636
+ test 0 -eq "$(git ls-files -o | wc -l)"
637
+ else
638
+ test 5 -eq "$(git ls-files -s | wc -l)" &&
639
+ test 3 -eq "$(git ls-files -u | wc -l)" &&
640
+ test 1 -eq "$(git ls-files -u one | wc -l)" &&
641
+ test 1 -eq "$(git ls-files -u two | wc -l)" &&
642
+ test 1 -eq "$(git ls-files -u original | wc -l)" &&
643
+ test 2 -eq "$(git ls-files -o | wc -l)"
644
+ fi &&
581
645
582
646
test_path_is_file one/file &&
583
647
test_path_is_file two/file &&
0 commit comments