tests: remove GIT_TEST_MERGE_ALGORITHM and test_expect_merge_algorithm
Both of these existed to allow us to reuse all the merge-related tests in the testsuite while easily flipping between the 'recursive' and the 'ort' backends. Now that we have removed merge-recursive and remapped 'recursive' to mean 'ort', we don't need this scaffolding anymore. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Apr 8, 2025 at 15:48 UTC
bfbd201e39b86028440fc95c47173d8da38e1cd2
29 files changed
+248
-874
ci/run-build-and-tests.sh
-1
@@ -20,7 +20,6 @@ linux-breaking-changes)
20
linux-TEST-vars)
21
export OPENSSL_SHA1_UNSAFE=YesPlease
22
export GIT_TEST_SPLIT_INDEX=yes
23
- export GIT_TEST_MERGE_ALGORITHM=recursive
23
export GIT_TEST_FULL_IN_PACK_ARRAY=true
24
export GIT_TEST_OE_SIZE=10
25
export GIT_TEST_OE_DELTA_SIZE=5
t/lib-merge.sh
deleted
-13
@@ -1,13 +0,0 @@
1
-# Helper functions used by merge tests.
2
-
3
-test_expect_merge_algorithm () {
4
- status_for_recursive=$1 status_for_ort=$2
5
- shift 2
6
-
7
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
8
- then
9
- test_expect_${status_for_ort} "$@"
10
- else
11
- test_expect_${status_for_recursive} "$@"
12
- fi
13
-}
t/t1092-sparse-checkout-compatibility.sh
-2
@@ -1486,7 +1486,6 @@ test_expect_success 'sparse-index is not expanded' '
1486
ensure_not_expanded checkout -f update-deep &&
1487
test_config -C sparse-index pull.twohead ort &&
1488
(
1489
- sane_unset GIT_TEST_MERGE_ALGORITHM &&
1489
for OPERATION in "merge -m merge" cherry-pick rebase
1490
do
1491
ensure_not_expanded merge -m merge update-folder1 &&
@@ -1506,7 +1505,6 @@ test_expect_success 'sparse-index is not expanded: merge conflict in cone' '
1505
done &&
1506
1507
(
1509
- sane_unset GIT_TEST_MERGE_ALGORITHM &&
1508
git -C sparse-index config pull.twohead ort &&
1509
ensure_not_expanded ! merge -m merged expand-right
1510
)
t/t2501-cwd-empty.sh
-2
@@ -117,8 +117,6 @@ test_expect_success 'merge fails if cwd needs to be removed; recursive friendly'
117
grep "Refusing to remove the current working directory" error
118
'
119
120
-GIT_TEST_MERGE_ALGORITHM=ort
121
-
120
test_expect_success 'merge fails if cwd needs to be removed' '
121
test_required_dir_removal git merge fd_conflict
122
'
t/t3512-cherry-pick-submodule.sh
-5
@@ -8,11 +8,6 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8
. ./test-lib.sh
9
. "$TEST_DIRECTORY"/lib-submodule-update.sh
10
11
-if test "$GIT_TEST_MERGE_ALGORITHM" != ort
12
-then
13
- KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
14
- KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
15
-fi
11
test_submodule_switch "cherry-pick"
12
13
test_expect_success 'unrelated submodule/file conflict is ignored' '
t/t3513-revert-submodule.sh
-4
@@ -30,10 +30,6 @@ git_revert () {
30
git revert HEAD
31
}
32
33
-if test "$GIT_TEST_MERGE_ALGORITHM" != ort
34
-then
35
- KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
36
-fi
33
test_submodule_switch_func "git_revert"
34
35
test_done
t/t4069-remerge-diff.sh
-7
@@ -4,13 +4,6 @@ test_description='remerge-diff handling'
4
5
. ./test-lib.sh
6
7
-# This test is ort-specific
8
-if test "${GIT_TEST_MERGE_ALGORITHM}" != ort
9
-then
10
- skip_all="GIT_TEST_MERGE_ALGORITHM != ort"
11
- test_done
12
-fi
13
-
7
test_expect_success 'setup basic merges' '
8
test_write_lines 1 2 3 4 5 6 7 8 9 >numbers &&
9
git add numbers &&
t/t4301-merge-tree-write-tree.sh
-7
@@ -4,13 +4,6 @@ test_description='git merge-tree --write-tree'
4
5
. ./test-lib.sh
6
7
-# This test is ort-specific
8
-if test "$GIT_TEST_MERGE_ALGORITHM" != "ort"
9
-then
10
- skip_all="GIT_TEST_MERGE_ALGORITHM != ort"
11
- test_done
12
-fi
13
-
7
test_expect_success setup '
8
test_write_lines 1 2 3 4 5 >numbers &&
9
echo hello >greeting &&
t/t5572-pull-submodule.sh
-5
@@ -45,11 +45,6 @@ git_pull_noff () {
45
$2 git pull --no-ff
46
}
47
48
-if test "$GIT_TEST_MERGE_ALGORITHM" != ort
49
-then
50
- KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
51
- KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
52
-fi
48
test_submodule_switch_func "git_pull_noff"
49
50
test_expect_success 'setup' '
t/t6400-merge-df.sh
+2
-12
@@ -84,12 +84,7 @@ test_expect_success 'modify/delete + directory/file conflict' '
84
85
test_stdout_line_count = 5 git ls-files -s &&
86
test_stdout_line_count = 4 git ls-files -u &&
87
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
88
- then
89
- test_stdout_line_count = 0 git ls-files -o
90
- else
91
- test_stdout_line_count = 1 git ls-files -o
92
- fi &&
87
+ test_stdout_line_count = 0 git ls-files -o &&
88
89
test_path_is_file letters/file &&
90
test_path_is_file letters.txt &&
@@ -105,12 +100,7 @@ test_expect_success 'modify/delete + directory/file conflict; other way' '
100
101
test_stdout_line_count = 5 git ls-files -s &&
102
test_stdout_line_count = 4 git ls-files -u &&
108
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
109
- then
110
- test_stdout_line_count = 0 git ls-files -o
111
- else
112
- test_stdout_line_count = 1 git ls-files -o
113
- fi &&
103
+ test_stdout_line_count = 0 git ls-files -o &&
104
105
test_path_is_file letters/file &&
106
test_path_is_file letters.txt &&
t/t6402-merge-rename.sh
+28
-97
@@ -313,12 +313,7 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' '
313
314
test_grep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
315
test_grep "Auto-merging dir" output &&
316
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
317
- then
318
- test_grep "moving it to dir~HEAD instead" output
319
- else
320
- test_grep "Adding as dir~HEAD instead" output
321
- fi &&
316
+ test_grep "moving it to dir~HEAD instead" output &&
317
318
test_stdout_line_count = 3 git ls-files -u &&
319
test_stdout_line_count = 2 git ls-files -u dir/file-in-the-way &&
@@ -340,12 +335,7 @@ test_expect_success 'Same as previous, but merged other way' '
335
! grep "error: refusing to lose untracked file at" errors &&
336
test_grep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
337
test_grep "Auto-merging dir" output &&
343
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
344
- then
345
- test_grep "moving it to dir~renamed-file-has-no-conflicts instead" output
346
- else
347
- test_grep "Adding as dir~renamed-file-has-no-conflicts instead" output
348
- fi &&
338
+ test_grep "moving it to dir~renamed-file-has-no-conflicts instead" output &&
339
340
test_stdout_line_count = 3 git ls-files -u &&
341
test_stdout_line_count = 2 git ls-files -u dir/file-in-the-way &&
@@ -400,14 +390,7 @@ test_expect_success 'Rename+D/F conflict; renamed file cannot merge and dir in t
390
test_must_fail git merge --strategy=recursive dir-in-way &&
391
392
test_stdout_line_count = 5 git ls-files -u &&
403
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
404
- then
405
- test_stdout_line_count = 3 git ls-files -u dir~HEAD
406
- else
407
- git ls-files -u dir >out &&
408
- test 3 -eq $(grep -v file-in-the-way out | wc -l) &&
409
- rm -f out
410
- fi &&
393
+ test_stdout_line_count = 3 git ls-files -u dir~HEAD &&
394
test_stdout_line_count = 2 git ls-files -u dir/file-in-the-way &&
395
396
test_must_fail git diff --quiet &&
@@ -425,14 +408,7 @@ test_expect_success 'Same as previous, but merged other way' '
408
test_must_fail git merge --strategy=recursive renamed-file-has-conflicts &&
409
410
test_stdout_line_count = 5 git ls-files -u &&
428
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
429
- then
430
- test_stdout_line_count = 3 git ls-files -u dir~renamed-file-has-conflicts
431
- else
432
- git ls-files -u dir >out &&
433
- test 3 -eq $(grep -v file-in-the-way out | wc -l) &&
434
- rm -f out
435
- fi &&
411
+ test_stdout_line_count = 3 git ls-files -u dir~renamed-file-has-conflicts &&
412
test_stdout_line_count = 2 git ls-files -u dir/file-in-the-way &&
413
414
test_must_fail git diff --quiet &&
@@ -488,12 +464,7 @@ test_expect_success 'both rename source and destination involved in D/F conflict
464
git checkout -q rename-dest^0 &&
465
test_must_fail git merge --strategy=recursive source-conflict &&
466
491
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
492
- then
493
- test_stdout_line_count = 2 git ls-files -u
494
- else
495
- test_stdout_line_count = 1 git ls-files -u
496
- fi &&
467
+ test_stdout_line_count = 2 git ls-files -u &&
468
469
test_must_fail git diff --quiet &&
470
@@ -527,63 +498,33 @@ test_expect_success 'setup pair rename to parent of other (D/F conflicts)' '
498
git commit -m "Rename one/file -> two"
499
'
500
530
-if test "$GIT_TEST_MERGE_ALGORITHM" = ort
531
-then
532
- test_expect_success 'pair rename to parent of other (D/F conflicts) w/ untracked dir' '
533
- git checkout -q rename-one^0 &&
534
- mkdir one &&
535
- test_must_fail git merge --strategy=recursive rename-two &&
536
-
537
- test_stdout_line_count = 4 git ls-files -u &&
538
- test_stdout_line_count = 2 git ls-files -u one &&
539
- test_stdout_line_count = 2 git ls-files -u two &&
540
-
541
- test_must_fail git diff --quiet &&
542
-
543
- test 3 -eq $(find . | grep -v .git | wc -l) &&
544
-
545
- test_path_is_file one &&
546
- test_path_is_file two &&
547
- test "other" = $(cat one) &&
548
- test "stuff" = $(cat two)
549
- '
550
-else
551
- test_expect_success 'pair rename to parent of other (D/F conflicts) w/ untracked dir' '
552
- git checkout -q rename-one^0 &&
553
- mkdir one &&
554
- test_must_fail git merge --strategy=recursive rename-two &&
501
+test_expect_success 'pair rename to parent of other (D/F conflicts) w/ untracked dir' '
502
+ git checkout -q rename-one^0 &&
503
+ mkdir one &&
504
+ test_must_fail git merge --strategy=recursive rename-two &&
505
556
- test_stdout_line_count = 2 git ls-files -u &&
557
- test_stdout_line_count = 1 git ls-files -u one &&
558
- test_stdout_line_count = 1 git ls-files -u two &&
506
+ test_stdout_line_count = 4 git ls-files -u &&
507
+ test_stdout_line_count = 2 git ls-files -u one &&
508
+ test_stdout_line_count = 2 git ls-files -u two &&
509
560
- test_must_fail git diff --quiet &&
510
+ test_must_fail git diff --quiet &&
511
562
- test 4 -eq $(find . | grep -v .git | wc -l) &&
512
+ test 3 -eq $(find . | grep -v .git | wc -l) &&
513
564
- test_path_is_dir one &&
565
- test_path_is_file one~rename-two &&
566
- test_path_is_file two &&
567
- test "other" = $(cat one~rename-two) &&
568
- test "stuff" = $(cat two)
569
- '
570
-fi
514
+ test_path_is_file one &&
515
+ test_path_is_file two &&
516
+ test "other" = $(cat one) &&
517
+ test "stuff" = $(cat two)
518
+'
519
520
test_expect_success 'pair rename to parent of other (D/F conflicts) w/ clean start' '
521
git reset --hard &&
522
git clean -fdqx &&
523
test_must_fail git merge --strategy=recursive rename-two &&
524
577
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
578
- then
579
- test_stdout_line_count = 4 git ls-files -u &&
580
- test_stdout_line_count = 2 git ls-files -u one &&
581
- test_stdout_line_count = 2 git ls-files -u two
582
- else
583
- test_stdout_line_count = 2 git ls-files -u &&
584
- test_stdout_line_count = 1 git ls-files -u one &&
585
- test_stdout_line_count = 1 git ls-files -u two
586
- fi &&
525
+ test_stdout_line_count = 4 git ls-files -u &&
526
+ test_stdout_line_count = 2 git ls-files -u one &&
527
+ test_stdout_line_count = 2 git ls-files -u two &&
528
529
test_must_fail git diff --quiet &&
530
@@ -623,22 +564,12 @@ test_expect_success 'check handling of differently renamed file with D/F conflic
564
git checkout -q first-rename^0 &&
565
test_must_fail git merge --strategy=recursive second-rename &&
566
626
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
627
- then
628
- test_stdout_line_count = 5 git ls-files -s &&
629
- test_stdout_line_count = 3 git ls-files -u &&
630
- test_stdout_line_count = 1 git ls-files -u one~HEAD &&
631
- test_stdout_line_count = 1 git ls-files -u two~second-rename &&
632
- test_stdout_line_count = 1 git ls-files -u original &&
633
- test_stdout_line_count = 0 git ls-files -o
634
- else
635
- test_stdout_line_count = 5 git ls-files -s &&
636
- test_stdout_line_count = 3 git ls-files -u &&
637
- test_stdout_line_count = 1 git ls-files -u one &&
638
- test_stdout_line_count = 1 git ls-files -u two &&
639
- test_stdout_line_count = 1 git ls-files -u original &&
640
- test_stdout_line_count = 2 git ls-files -o
641
- fi &&
567
+ test_stdout_line_count = 5 git ls-files -s &&
568
+ test_stdout_line_count = 3 git ls-files -u &&
569
+ test_stdout_line_count = 1 git ls-files -u one~HEAD &&
570
+ test_stdout_line_count = 1 git ls-files -u two~second-rename &&
571
+ test_stdout_line_count = 1 git ls-files -u original &&
572
+ test_stdout_line_count = 0 git ls-files -o &&
573
574
test_path_is_file one/file &&
575
test_path_is_file two/file &&
t/t6404-recursive-merge.sh
+3
-18
@@ -108,12 +108,7 @@ test_expect_success 'refuse to merge binary files' '
108
printf "\0\0" >binary-file &&
109
git add binary-file &&
110
git commit -m binary2 &&
111
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
112
- then
113
- test_must_fail git merge F >merge_output
114
- else
115
- test_must_fail git merge F 2>merge_output
116
- fi &&
111
+ test_must_fail git merge F >merge_output &&
112
grep "Cannot merge binary files: binary-file (HEAD vs. F)" merge_output
113
'
114
@@ -129,22 +124,12 @@ test_expect_success 'mark rename/delete as unmerged' '
124
test_tick &&
125
git commit -m rename &&
126
test_must_fail git merge delete &&
132
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
133
- then
134
- test 2 = $(git ls-files --unmerged | wc -l)
135
- else
136
- test 1 = $(git ls-files --unmerged | wc -l)
137
- fi &&
127
+ test 2 = $(git ls-files --unmerged | wc -l) &&
128
git rev-parse --verify :2:a2 &&
129
test_must_fail git rev-parse --verify :3:a2 &&
130
git checkout -f delete &&
131
test_must_fail git merge rename &&
142
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
143
- then
144
- test 2 = $(git ls-files --unmerged | wc -l)
145
- else
146
- test 1 = $(git ls-files --unmerged | wc -l)
147
- fi &&
132
+ test 2 = $(git ls-files --unmerged | wc -l) &&
133
test_must_fail git rev-parse --verify :2:a2 &&
134
git rev-parse --verify :3:a2
135
'
t/t6406-merge-attr.sh
+1
-6
@@ -259,12 +259,7 @@ test_expect_success 'binary files with union attribute' '
259
printf "two\0" >bin.txt &&
260
git commit -am two &&
261
262
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
263
- then
264
- test_must_fail git merge bin-main >output
265
- else
266
- test_must_fail git merge bin-main 2>output
267
- fi &&
262
+ test_must_fail git merge bin-main >output &&
263
grep -i "warning.*cannot merge.*HEAD vs. bin-main" output
264
'
265
t/t6416-recursive-corner-cases.sh
+55
-139
@@ -6,7 +6,6 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8
. ./test-lib.sh
9
-. "$TEST_DIRECTORY"/lib-merge.sh
9
10
#
11
# L1 L2
@@ -529,15 +528,8 @@ test_expect_success 'setup differently handled merges of directory/file conflict
528
529
git checkout B^0 &&
530
test_must_fail git merge C^0 &&
532
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
533
- then
534
- git rm -rf a/ &&
535
- git rm a~HEAD
536
- else
537
- git clean -fd &&
538
- git rm -rf a/ &&
539
- git rm a
540
- fi &&
531
+ git rm -rf a/ &&
532
+ git rm a~HEAD &&
533
git cat-file -p B:a >a2 &&
534
git add a2 &&
535
git commit -m D2 &&
@@ -556,12 +548,7 @@ test_expect_success 'setup differently handled merges of directory/file conflict
548
549
git checkout C^0 &&
550
test_must_fail git merge B^0 &&
559
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
560
- then
561
- git rm a~B^0
562
- else
563
- git clean -fd
564
- fi &&
551
+ git rm a~B^0 &&
552
git rm -rf a/ &&
553
test_write_lines 1 2 3 4 5 6 7 8 >a &&
554
git add a &&
@@ -570,15 +557,8 @@ test_expect_success 'setup differently handled merges of directory/file conflict
557
558
git checkout C^0 &&
559
test_must_fail git merge B^0 &&
573
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
574
- then
575
- git rm -rf a/ &&
576
- git rm a~B^0
577
- else
578
- git clean -fd &&
579
- git rm -rf a/ &&
580
- git rm a
581
- fi &&
560
+ git rm -rf a/ &&
561
+ git rm a~B^0 &&
562
test_write_lines 1 2 3 4 5 6 7 8 >a2 &&
563
git add a2 &&
564
git commit -m E4 &&
@@ -596,34 +576,16 @@ test_expect_success 'merge of D1 & E1 fails but has appropriate contents' '
576
577
test_must_fail git merge -s recursive E1^0 &&
578
599
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
600
- then
601
- git ls-files -s >out &&
602
- test_line_count = 3 out &&
603
- git ls-files -u >out &&
604
- test_line_count = 2 out &&
605
- git ls-files -o >out &&
606
- test_line_count = 1 out &&
607
-
608
- git rev-parse >expect \
609
- A:ignore-me B:a D1:a &&
610
- git rev-parse >actual \
611
- :0:ignore-me :1:a :2:a &&
612
- test_cmp expect actual
613
- else
614
- git ls-files -s >out &&
615
- test_line_count = 2 out &&
616
- git ls-files -u >out &&
617
- test_line_count = 1 out &&
618
- git ls-files -o >out &&
619
- test_line_count = 1 out &&
620
-
621
- git rev-parse >expect \
622
- A:ignore-me B:a &&
623
- git rev-parse >actual \
624
- :0:ignore-me :2:a &&
625
- test_cmp expect actual
626
- fi
579
+ git ls-files -s >out &&
580
+ test_line_count = 3 out &&
581
+ git ls-files -u >out &&
582
+ test_line_count = 2 out &&
583
+ git ls-files -o >out &&
584
+ test_line_count = 1 out &&
585
+
586
+ git rev-parse >expect A:ignore-me B:a D1:a &&
587
+ git rev-parse >actual :0:ignore-me :1:a :2:a &&
588
+ test_cmp expect actual
589
)
590
'
591
@@ -637,34 +599,18 @@ test_expect_success 'merge of E1 & D1 fails but has appropriate contents' '
599
600
test_must_fail git merge -s recursive D1^0 &&
601
640
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
641
- then
642
- git ls-files -s >out &&
643
- test_line_count = 3 out &&
644
- git ls-files -u >out &&
645
- test_line_count = 2 out &&
646
- git ls-files -o >out &&
647
- test_line_count = 1 out &&
648
-
649
- git rev-parse >expect \
650
- A:ignore-me B:a D1:a &&
651
- git rev-parse >actual \
652
- :0:ignore-me :1:a :3:a &&
653
- test_cmp expect actual
654
- else
655
- git ls-files -s >out &&
656
- test_line_count = 2 out &&
657
- git ls-files -u >out &&
658
- test_line_count = 1 out &&
659
- git ls-files -o >out &&
660
- test_line_count = 1 out &&
661
-
662
- git rev-parse >expect \
663
- A:ignore-me B:a &&
664
- git rev-parse >actual \
665
- :0:ignore-me :3:a &&
666
- test_cmp expect actual
667
- fi
602
+ git ls-files -s >out &&
603
+ test_line_count = 3 out &&
604
+ git ls-files -u >out &&
605
+ test_line_count = 2 out &&
606
+ git ls-files -o >out &&
607
+ test_line_count = 1 out &&
608
+
609
+ git rev-parse >expect \
610
+ A:ignore-me B:a D1:a &&
611
+ git rev-parse >actual \
612
+ :0:ignore-me :1:a :3:a &&
613
+ test_cmp expect actual
614
)
615
'
616
@@ -678,32 +624,17 @@ test_expect_success 'merge of D1 & E2 fails but has appropriate contents' '
624
625
test_must_fail git merge -s recursive E2^0 &&
626
681
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
682
- then
683
- git ls-files -s >out &&
684
- test_line_count = 5 out &&
685
- git ls-files -u >out &&
686
- test_line_count = 4 out &&
687
- git ls-files -o >out &&
688
- test_line_count = 1 out &&
689
-
690
- git rev-parse >expect \
691
- B:a D1:a E2:a/file C:a/file A:ignore-me &&
692
- git rev-parse >actual \
693
- :1:a~HEAD :2:a~HEAD :3:a/file :1:a/file :0:ignore-me
694
- else
695
- git ls-files -s >out &&
696
- test_line_count = 4 out &&
697
- git ls-files -u >out &&
698
- test_line_count = 3 out &&
699
- git ls-files -o >out &&
700
- test_line_count = 2 out &&
701
-
702
- git rev-parse >expect \
703
- B:a E2:a/file C:a/file A:ignore-me &&
704
- git rev-parse >actual \
705
- :2:a :3:a/file :1:a/file :0:ignore-me
706
- fi &&
627
+ git ls-files -s >out &&
628
+ test_line_count = 5 out &&
629
+ git ls-files -u >out &&
630
+ test_line_count = 4 out &&
631
+ git ls-files -o >out &&
632
+ test_line_count = 1 out &&
633
+
634
+ git rev-parse >expect \
635
+ B:a D1:a E2:a/file C:a/file A:ignore-me &&
636
+ git rev-parse >actual \
637
+ :1:a~HEAD :2:a~HEAD :3:a/file :1:a/file :0:ignore-me &&
638
test_cmp expect actual &&
639
640
test_path_is_file a~HEAD
@@ -720,32 +651,17 @@ test_expect_success 'merge of E2 & D1 fails but has appropriate contents' '
651
652
test_must_fail git merge -s recursive D1^0 &&
653
723
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
724
- then
725
- git ls-files -s >out &&
726
- test_line_count = 5 out &&
727
- git ls-files -u >out &&
728
- test_line_count = 4 out &&
729
- git ls-files -o >out &&
730
- test_line_count = 1 out &&
731
-
732
- git rev-parse >expect \
733
- B:a D1:a E2:a/file C:a/file A:ignore-me &&
734
- git rev-parse >actual \
735
- :1:a~D1^0 :3:a~D1^0 :2:a/file :1:a/file :0:ignore-me
736
- else
737
- git ls-files -s >out &&
738
- test_line_count = 4 out &&
739
- git ls-files -u >out &&
740
- test_line_count = 3 out &&
741
- git ls-files -o >out &&
742
- test_line_count = 2 out &&
743
-
744
- git rev-parse >expect \
745
- B:a E2:a/file C:a/file A:ignore-me &&
746
- git rev-parse >actual \
747
- :3:a :2:a/file :1:a/file :0:ignore-me
748
- fi &&
654
+ git ls-files -s >out &&
655
+ test_line_count = 5 out &&
656
+ git ls-files -u >out &&
657
+ test_line_count = 4 out &&
658
+ git ls-files -o >out &&
659
+ test_line_count = 1 out &&
660
+
661
+ git rev-parse >expect \
662
+ B:a D1:a E2:a/file C:a/file A:ignore-me &&
663
+ git rev-parse >actual \
664
+ :1:a~D1^0 :3:a~D1^0 :2:a/file :1:a/file :0:ignore-me &&
665
test_cmp expect actual &&
666
667
test_path_is_file a~D1^0
@@ -777,7 +693,7 @@ test_expect_success 'merge of D1 & E3 succeeds' '
693
)
694
'
695
780
-test_expect_merge_algorithm failure success 'merge of D1 & E4 puts merge of a and a2 in both a and a2' '
696
+test_expect_success 'merge of D1 & E4 puts merge of a and a2 in both a and a2' '
697
test_when_finished "git -C directory-file reset --hard" &&
698
test_when_finished "git -C directory-file clean -fdqx" &&
699
(
@@ -1140,7 +1056,7 @@ test_expect_success 'setup symlink modify/modify' '
1056
)
1057
'
1058
1143
-test_expect_merge_algorithm failure success 'check symlink modify/modify' '
1059
+test_expect_success 'check symlink modify/modify' '
1060
(
1061
cd symlink-modify-modify &&
1062
@@ -1206,7 +1122,7 @@ test_expect_success 'setup symlink add/add' '
1122
)
1123
'
1124
1209
-test_expect_merge_algorithm failure success 'check symlink add/add' '
1125
+test_expect_success 'check symlink add/add' '
1126
(
1127
cd symlink-add-add &&
1128
@@ -1294,7 +1210,7 @@ test_expect_success 'setup submodule modify/modify' '
1210
)
1211
'
1212
1297
-test_expect_merge_algorithm failure success 'check submodule modify/modify' '
1213
+test_expect_success 'check submodule modify/modify' '
1214
(
1215
cd submodule-modify-modify &&
1216
@@ -1382,7 +1298,7 @@ test_expect_success 'setup submodule add/add' '
1298
)
1299
'
1300
1385
-test_expect_merge_algorithm failure success 'check submodule add/add' '
1301
+test_expect_success 'check submodule add/add' '
1302
(
1303
cd submodule-add-add &&
1304
@@ -1457,7 +1373,7 @@ test_expect_success 'setup conflicting entry types (submodule vs symlink)' '
1373
)
1374
'
1375
1460
-test_expect_merge_algorithm failure success 'check conflicting entry types (submodule vs symlink)' '
1376
+test_expect_success 'check conflicting entry types (submodule vs symlink)' '
1377
(
1378
cd submodule-symlink-add-add &&
1379
t/t6421-merge-partial-clone.sh
+3
-4
@@ -27,7 +27,6 @@ test_description="limiting blob downloads when merging with partial clones"
27
# files that might be renamed into each other's paths.)
28
29
. ./test-lib.sh
30
-. "$TEST_DIRECTORY"/lib-merge.sh
30
31
test_setup_repo () {
32
test -d server && return
@@ -207,7 +206,7 @@ test_setup_repo () {
206
#
207
# Summary: 2 fetches (1 for 2 objects, 1 for 1 object)
208
#
210
-test_expect_merge_algorithm failure success 'Objects downloaded for single relevant rename' '
209
+test_expect_success 'Objects downloaded for single relevant rename' '
210
test_setup_repo &&
211
git clone --sparse --filter=blob:none "file://$(pwd)/server" objects-single &&
212
(
@@ -297,7 +296,7 @@ test_expect_merge_algorithm failure success 'Objects downloaded for single relev
296
# this are not all that common.)
297
# Summary: 1 fetches for 6 objects
298
#
300
-test_expect_merge_algorithm failure success 'Objects downloaded when a directory rename triggered' '
299
+test_expect_success 'Objects downloaded when a directory rename triggered' '
300
test_setup_repo &&
301
git clone --sparse --filter=blob:none "file://$(pwd)/server" objects-dir &&
302
(
@@ -399,7 +398,7 @@ test_expect_merge_algorithm failure success 'Objects downloaded when a directory
398
#
399
# Summary: 4 fetches (1 for 6 objects, 1 for 8, 1 for 3, 1 for 2)
400
#
402
-test_expect_merge_algorithm failure success 'Objects downloaded with lots of renames and modifications' '
401
+test_expect_success 'Objects downloaded with lots of renames and modifications' '
402
test_setup_repo &&
403
git clone --sparse --filter=blob:none "file://$(pwd)/server" objects-many &&
404
(
t/t6422-merge-rename-corner-cases.sh
+7
-24
@@ -7,7 +7,6 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
7
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8
9
. ./test-lib.sh
10
-. "$TEST_DIRECTORY"/lib-merge.sh
10
11
test_setup_rename_delete_untracked () {
12
git init rename-delete-untracked &&
@@ -316,12 +315,7 @@ test_expect_success 'rename/directory conflict + clean content merge' '
315
git ls-files -u >out &&
316
test_line_count = 1 out &&
317
git ls-files -o >out &&
319
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
320
- then
321
- test_line_count = 1 out
322
- else
323
- test_line_count = 2 out
324
- fi &&
318
+ test_line_count = 1 out &&
319
320
echo 0 >expect &&
321
git cat-file -p base:file >>expect &&
@@ -350,12 +344,7 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
344
git ls-files -u >out &&
345
test_line_count = 3 out &&
346
git ls-files -o >out &&
353
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
354
- then
355
- test_line_count = 1 out
356
- else
357
- test_line_count = 2 out
358
- fi &&
347
+ test_line_count = 1 out &&
348
349
git cat-file -p left-conflict:newfile >left &&
350
git cat-file -p base:file >base &&
@@ -369,14 +358,8 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
358
359
git rev-parse >expect \
360
base:file left-conflict:newfile right:file &&
372
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
373
- then
374
- git rev-parse >actual \
375
- :1:newfile~HEAD :2:newfile~HEAD :3:newfile~HEAD
376
- else
377
- git rev-parse >actual \
378
- :1:newfile :2:newfile :3:newfile
379
- fi &&
361
+ git rev-parse >actual \
362
+ :1:newfile~HEAD :2:newfile~HEAD :3:newfile~HEAD &&
363
test_cmp expect actual &&
364
365
test_path_is_file newfile/realfile &&
@@ -896,7 +879,7 @@ test_setup_rad () {
879
)
880
}
881
899
-test_expect_merge_algorithm failure success 'rad-check: rename/add/delete conflict' '
882
+test_expect_success 'rad-check: rename/add/delete conflict' '
883
test_setup_rad &&
884
(
885
cd rad &&
@@ -969,7 +952,7 @@ test_setup_rrdd () {
952
)
953
}
954
972
-test_expect_merge_algorithm failure success 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
955
+test_expect_success 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
956
test_setup_rrdd &&
957
(
958
cd rrdd &&
@@ -1058,7 +1041,7 @@ test_setup_mod6 () {
1041
)
1042
}
1043
1061
-test_expect_merge_algorithm failure success 'mod6-check: chains of rename/rename(1to2) and rename/rename(2to1)' '
1044
+test_expect_success 'mod6-check: chains of rename/rename(1to2) and rename/rename(2to1)' '
1045
test_setup_mod6 &&
1046
(
1047
cd mod6 &&
t/t6423-merge-rename-directories.sh
+105
-412
@@ -26,8 +26,6 @@ test_description="recursive merge with directory renames"
26
# files that might be renamed into each other's paths.)
27
28
. ./test-lib.sh
29
-. "$TEST_DIRECTORY"/lib-merge.sh
30
-
29
30
###########################################################################
31
# SECTION 1: Basic cases we should be able to handle
@@ -302,20 +300,11 @@ test_expect_success '1d: Directory renames cause a rename/rename(2to1) conflict'
300
git cat-file -p :2:x/wham >expect &&
301
git cat-file -p :3:x/wham >other &&
302
>empty &&
305
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
306
- then
307
- test_must_fail git merge-file \
308
- -L "HEAD:y/wham" \
309
- -L "" \
310
- -L "B^0:z/wham" \
311
- expect empty other
312
- else
313
- test_must_fail git merge-file \
314
- -L "HEAD" \
315
- -L "" \
316
- -L "B^0" \
317
- expect empty other
318
- fi &&
303
+ test_must_fail git merge-file \
304
+ -L "HEAD:y/wham" \
305
+ -L "" \
306
+ -L "B^0:z/wham" \
307
+ expect empty other &&
308
test_cmp expect x/wham
309
)
310
'
@@ -1186,18 +1175,10 @@ test_expect_success '5d: Directory/file/file conflict due to directory rename' '
1175
git ls-files -u >out &&
1176
test_line_count = 1 out &&
1177
git ls-files -o >out &&
1189
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
1190
- then
1191
- test_line_count = 1 out &&
1192
-
1193
- git rev-parse >actual \
1194
- :0:y/b :0:y/c :0:z/d :0:y/f :2:y/d~HEAD :0:y/d/e
1195
- else
1196
- test_line_count = 2 out &&
1197
-
1198
- git rev-parse >actual \
1199
- :0:y/b :0:y/c :0:z/d :0:y/f :2:y/d :0:y/d/e
1200
- fi &&
1178
+ test_line_count = 1 out &&
1179
+
1180
+ git rev-parse >actual \
1181
+ :0:y/b :0:y/c :0:z/d :0:y/f :2:y/d~HEAD :0:y/d/e &&
1182
git rev-parse >expect \
1183
O:z/b O:z/c B:z/d B:z/f A:y/d B:y/d/e &&
1184
test_cmp expect actual &&
@@ -1280,32 +1261,17 @@ test_expect_success '6a: Tricky rename/delete' '
1261
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
1262
test_grep "CONFLICT (rename/delete).*z/c.*y/c" out &&
1263
1283
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
1284
- then
1285
- git ls-files -s >out &&
1286
- test_line_count = 3 out &&
1287
- git ls-files -u >out &&
1288
- test_line_count = 2 out &&
1289
- git ls-files -o >out &&
1290
- test_line_count = 1 out &&
1291
-
1292
- git rev-parse >actual \
1293
- :0:y/b :1:y/c :3:y/c &&
1294
- git rev-parse >expect \
1295
- O:z/b O:z/c O:z/c
1296
- else
1297
- git ls-files -s >out &&
1298
- test_line_count = 2 out &&
1299
- git ls-files -u >out &&
1300
- test_line_count = 1 out &&
1301
- git ls-files -o >out &&
1302
- test_line_count = 1 out &&
1303
-
1304
- git rev-parse >actual \
1305
- :0:y/b :3:y/c &&
1306
- git rev-parse >expect \
1307
- O:z/b O:z/c
1308
- fi &&
1264
+ git ls-files -s >out &&
1265
+ test_line_count = 3 out &&
1266
+ git ls-files -u >out &&
1267
+ test_line_count = 2 out &&
1268
+ git ls-files -o >out &&
1269
+ test_line_count = 1 out &&
1270
+
1271
+ git rev-parse >actual \
1272
+ :0:y/b :1:y/c :3:y/c &&
1273
+ git rev-parse >expect \
1274
+ O:z/b O:z/c O:z/c &&
1275
test_cmp expect actual
1276
)
1277
'
@@ -1372,7 +1338,7 @@ test_setup_6b1 () {
1338
)
1339
}
1340
1375
-test_expect_merge_algorithm failure success '6b1: Same renames done on both sides, plus another rename' '
1341
+test_expect_success '6b1: Same renames done on both sides, plus another rename' '
1342
test_setup_6b1 &&
1343
(
1344
cd 6b1 &&
@@ -1445,7 +1411,7 @@ test_setup_6b2 () {
1411
)
1412
}
1413
1448
-test_expect_merge_algorithm failure success '6b2: Same rename done on both sides' '
1414
+test_expect_success '6b2: Same rename done on both sides' '
1415
test_setup_6b2 &&
1416
(
1417
cd 6b2 &&
@@ -1832,20 +1798,11 @@ test_expect_success '7b: rename/rename(2to1), but only due to transitive rename'
1798
git cat-file -p :2:y/d >expect &&
1799
git cat-file -p :3:y/d >other &&
1800
>empty &&
1835
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
1836
- then
1837
- test_must_fail git merge-file \
1838
- -L "HEAD:y/d" \
1839
- -L "" \
1840
- -L "B^0:z/d" \
1841
- expect empty other
1842
- else
1843
- test_must_fail git merge-file \
1844
- -L "HEAD" \
1845
- -L "" \
1846
- -L "B^0" \
1847
- expect empty other
1848
- fi &&
1801
+ test_must_fail git merge-file \
1802
+ -L "HEAD:y/d" \
1803
+ -L "" \
1804
+ -L "B^0:z/d" \
1805
+ expect empty other &&
1806
test_cmp expect y/d
1807
)
1808
'
@@ -1967,32 +1924,17 @@ test_expect_success '7d: transitive rename involved in rename/delete; how is it
1924
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
1925
test_grep "CONFLICT (rename/delete).*x/d.*y/d" out &&
1926
1970
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
1971
- then
1972
- git ls-files -s >out &&
1973
- test_line_count = 4 out &&
1974
- git ls-files -u >out &&
1975
- test_line_count = 2 out &&
1976
- git ls-files -o >out &&
1977
- test_line_count = 1 out &&
1978
-
1979
- git rev-parse >actual \
1980
- :0:y/b :0:y/c :1:y/d :3:y/d &&
1981
- git rev-parse >expect \
1982
- O:z/b O:z/c O:x/d O:x/d
1983
- else
1984
- git ls-files -s >out &&
1985
- test_line_count = 3 out &&
1986
- git ls-files -u >out &&
1987
- test_line_count = 1 out &&
1988
- git ls-files -o >out &&
1989
- test_line_count = 1 out &&
1990
-
1991
- git rev-parse >actual \
1992
- :0:y/b :0:y/c :3:y/d &&
1993
- git rev-parse >expect \
1994
- O:z/b O:z/c O:x/d
1995
- fi &&
1927
+ git ls-files -s >out &&
1928
+ test_line_count = 4 out &&
1929
+ git ls-files -u >out &&
1930
+ test_line_count = 2 out &&
1931
+ git ls-files -o >out &&
1932
+ test_line_count = 1 out &&
1933
+
1934
+ git rev-parse >actual \
1935
+ :0:y/b :0:y/c :1:y/d :3:y/d &&
1936
+ git rev-parse >expect \
1937
+ O:z/b O:z/c O:x/d O:x/d &&
1938
test_cmp expect actual
1939
)
1940
'
@@ -2073,32 +2015,17 @@ test_expect_success '7e: transitive rename in rename/delete AND dirs in the way'
2015
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
2016
test_grep "CONFLICT (rename/delete).*x/d.*y/d" out &&
2017
2076
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
2077
- then
2078
- git ls-files -s >out &&
2079
- test_line_count = 6 out &&
2080
- git ls-files -u >out &&
2081
- test_line_count = 2 out &&
2082
- git ls-files -o >out &&
2083
- test_line_count = 1 out &&
2084
-
2085
- git rev-parse >actual \
2086
- :0:x/d/f :0:y/d/g :0:y/b :0:y/c :1:y/d~B^0 :3:y/d~B^0 &&
2087
- git rev-parse >expect \
2088
- A:x/d/f A:y/d/g O:z/b O:z/c O:x/d O:x/d
2089
- else
2090
- git ls-files -s >out &&
2091
- test_line_count = 5 out &&
2092
- git ls-files -u >out &&
2093
- test_line_count = 1 out &&
2094
- git ls-files -o >out &&
2095
- test_line_count = 2 out &&
2096
-
2097
- git rev-parse >actual \
2098
- :0:x/d/f :0:y/d/g :0:y/b :0:y/c :3:y/d &&
2099
- git rev-parse >expect \
2100
- A:x/d/f A:y/d/g O:z/b O:z/c O:x/d
2101
- fi &&
2018
+ git ls-files -s >out &&
2019
+ test_line_count = 6 out &&
2020
+ git ls-files -u >out &&
2021
+ test_line_count = 2 out &&
2022
+ git ls-files -o >out &&
2023
+ test_line_count = 1 out &&
2024
+
2025
+ git rev-parse >actual \
2026
+ :0:x/d/f :0:y/d/g :0:y/b :0:y/c :1:y/d~B^0 :3:y/d~B^0 &&
2027
+ git rev-parse >expect \
2028
+ A:x/d/f A:y/d/g O:z/b O:z/c O:x/d O:x/d &&
2029
test_cmp expect actual &&
2030
2031
git hash-object y/d~B^0 >actual &&
@@ -3284,34 +3211,15 @@ test_expect_success '10b: Overwrite untracked with dir rename + delete' '
3211
echo contents >y/e &&
3212
3213
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
3287
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
3288
- then
3289
- test_path_is_missing .git/MERGE_HEAD &&
3290
- test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
3291
-
3292
- git ls-files -s >out &&
3293
- test_line_count = 1 out &&
3294
- git ls-files -u >out &&
3295
- test_line_count = 0 out &&
3296
- git ls-files -o >out &&
3297
- test_line_count = 5 out
3298
- else
3299
- test_grep "CONFLICT (rename/delete).*Version B\^0 of y/d left in tree at y/d~B\^0" out &&
3300
- test_grep "Error: Refusing to lose untracked file at y/e; writing to y/e~B\^0 instead" out &&
3301
-
3302
- git ls-files -s >out &&
3303
- test_line_count = 3 out &&
3304
- git ls-files -u >out &&
3305
- test_line_count = 2 out &&
3306
- git ls-files -o >out &&
3307
- test_line_count = 5 out &&
3308
-
3309
- git rev-parse >actual \
3310
- :0:y/b :3:y/d :3:y/e &&
3311
- git rev-parse >expect \
3312
- O:z/b O:z/c B:z/e &&
3313
- test_cmp expect actual
3314
- fi &&
3214
+ test_path_is_missing .git/MERGE_HEAD &&
3215
+ test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
3216
+
3217
+ git ls-files -s >out &&
3218
+ test_line_count = 1 out &&
3219
+ git ls-files -u >out &&
3220
+ test_line_count = 0 out &&
3221
+ git ls-files -o >out &&
3222
+ test_line_count = 5 out &&
3223
3224
echo very >expect &&
3225
test_cmp expect y/c &&
@@ -3374,38 +3282,15 @@ test_expect_success '10c1: Overwrite untracked with dir rename/rename(1to2)' '
3282
echo important >y/c &&
3283
3284
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
3377
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
3378
- then
3379
- test_path_is_missing .git/MERGE_HEAD &&
3380
- test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
3381
-
3382
- git ls-files -s >out &&
3383
- test_line_count = 4 out &&
3384
- git ls-files -u >out &&
3385
- test_line_count = 0 out &&
3386
- git ls-files -o >out &&
3387
- test_line_count = 3 out
3388
- else
3389
- test_grep "CONFLICT (rename/rename)" out &&
3390
- test_grep "Refusing to lose untracked file at y/c; adding as y/c~B\^0 instead" out &&
3391
-
3392
- git ls-files -s >out &&
3393
- test_line_count = 6 out &&
3394
- git ls-files -u >out &&
3395
- test_line_count = 3 out &&
3396
- git ls-files -o >out &&
3397
- test_line_count = 3 out &&
3398
-
3399
- git rev-parse >actual \
3400
- :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :3:y/c &&
3401
- git rev-parse >expect \
3402
- O:z/a O:z/b O:x/d O:x/c O:x/c O:x/c &&
3403
- test_cmp expect actual &&
3404
-
3405
- git hash-object y/c~B^0 >actual &&
3406
- git rev-parse O:x/c >expect &&
3407
- test_cmp expect actual
3408
- fi &&
3285
+ test_path_is_missing .git/MERGE_HEAD &&
3286
+ test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
3287
+
3288
+ git ls-files -s >out &&
3289
+ test_line_count = 4 out &&
3290
+ git ls-files -u >out &&
3291
+ test_line_count = 0 out &&
3292
+ git ls-files -o >out &&
3293
+ test_line_count = 3 out &&
3294
3295
echo important >expect &&
3296
test_cmp expect y/c
@@ -3425,38 +3310,15 @@ test_expect_success '10c2: Overwrite untracked with dir rename/rename(1to2), oth
3310
echo important >y/c &&
3311
3312
test_must_fail git -c merge.directoryRenames=true merge -s recursive A^0 >out 2>err &&
3428
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
3429
- then
3430
- test_path_is_missing .git/MERGE_HEAD &&
3431
- test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
3432
-
3433
- git ls-files -s >out &&
3434
- test_line_count = 4 out &&
3435
- git ls-files -u >out &&
3436
- test_line_count = 0 out &&
3437
- git ls-files -o >out &&
3438
- test_line_count = 3 out
3439
- else
3440
- test_grep "CONFLICT (rename/rename)" out &&
3441
- test_grep "Refusing to lose untracked file at y/c; adding as y/c~HEAD instead" out &&
3442
-
3443
- git ls-files -s >out &&
3444
- test_line_count = 6 out &&
3445
- git ls-files -u >out &&
3446
- test_line_count = 3 out &&
3447
- git ls-files -o >out &&
3448
- test_line_count = 3 out &&
3449
-
3450
- git rev-parse >actual \
3451
- :0:y/a :0:y/b :0:x/d :1:x/c :3:w/c :2:y/c &&
3452
- git rev-parse >expect \
3453
- O:z/a O:z/b O:x/d O:x/c O:x/c O:x/c &&
3454
- test_cmp expect actual &&
3455
-
3456
- git hash-object y/c~HEAD >actual &&
3457
- git rev-parse O:x/c >expect &&
3458
- test_cmp expect actual
3459
- fi &&
3313
+ test_path_is_missing .git/MERGE_HEAD &&
3314
+ test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
3315
+
3316
+ git ls-files -s >out &&
3317
+ test_line_count = 4 out &&
3318
+ git ls-files -u >out &&
3319
+ test_line_count = 0 out &&
3320
+ git ls-files -o >out &&
3321
+ test_line_count = 3 out &&
3322
3323
echo important >expect &&
3324
test_cmp expect y/c
@@ -3514,47 +3376,15 @@ test_expect_success '10d: Delete untracked with dir rename/rename(2to1)' '
3376
echo important >y/wham &&
3377
3378
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
3517
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
3518
- then
3519
- test_path_is_missing .git/MERGE_HEAD &&
3520
- test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
3521
-
3522
- git ls-files -s >out &&
3523
- test_line_count = 6 out &&
3524
- git ls-files -u >out &&
3525
- test_line_count = 0 out &&
3526
- git ls-files -o >out &&
3527
- test_line_count = 3 out
3528
- else
3529
- test_grep "CONFLICT (rename/rename)" out &&
3530
- test_grep "Refusing to lose untracked file at y/wham" out &&
3531
-
3532
- git ls-files -s >out &&
3533
- test_line_count = 6 out &&
3534
- git ls-files -u >out &&
3535
- test_line_count = 2 out &&
3536
- git ls-files -o >out &&
3537
- test_line_count = 3 out &&
3538
-
3539
- git rev-parse >actual \
3540
- :0:y/a :0:y/b :0:y/d :0:y/e :2:y/wham :3:y/wham &&
3541
- git rev-parse >expect \
3542
- O:z/a O:z/b O:x/d O:x/e O:z/c O:x/f &&
3543
- test_cmp expect actual &&
3544
-
3545
- test_must_fail git rev-parse :1:y/wham &&
3546
-
3547
- # Test that two-way merge in y/wham~merged is as expected
3548
- git cat-file -p :2:y/wham >expect &&
3549
- git cat-file -p :3:y/wham >other &&
3550
- >empty &&
3551
- test_must_fail git merge-file \
3552
- -L "HEAD" \
3553
- -L "" \
3554
- -L "B^0" \
3555
- expect empty other &&
3556
- test_cmp expect y/wham~merged
3557
- fi &&
3379
+ test_path_is_missing .git/MERGE_HEAD &&
3380
+ test_grep "error: The following untracked working tree files would be overwritten by merge" err &&
3381
+
3382
+ git ls-files -s >out &&
3383
+ test_line_count = 6 out &&
3384
+ git ls-files -u >out &&
3385
+ test_line_count = 0 out &&
3386
+ git ls-files -o >out &&
3387
+ test_line_count = 3 out &&
3388
3389
echo important >expect &&
3390
test_cmp expect y/wham
@@ -3596,7 +3426,7 @@ test_setup_10e () {
3426
)
3427
}
3428
3599
-test_expect_merge_algorithm failure success '10e: Does git complain about untracked file that is not really in the way?' '
3429
+test_expect_success '10e: Does git complain about untracked file that is not really in the way?' '
3430
test_setup_10e &&
3431
(
3432
cd 10e &&
@@ -3687,30 +3517,8 @@ test_expect_success '11a: Avoid losing dirty contents with simple rename' '
3517
echo stuff >>z/c &&
3518
3519
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
3690
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
3691
- then
3692
- test_path_is_missing .git/MERGE_HEAD &&
3693
- test_grep "error: Your local changes to the following files would be overwritten by merge" err
3694
- else
3695
- test_grep "Refusing to lose dirty file at z/c" out &&
3696
-
3697
- git ls-files -s >out &&
3698
- test_line_count = 2 out &&
3699
- git ls-files -u >out &&
3700
- test_line_count = 1 out &&
3701
- git ls-files -o >out &&
3702
- test_line_count = 3 out &&
3703
-
3704
- git rev-parse >actual \
3705
- :0:z/a :2:z/c &&
3706
- git rev-parse >expect \
3707
- O:z/a B:z/b &&
3708
- test_cmp expect actual &&
3709
-
3710
- git hash-object z/c~HEAD >actual &&
3711
- git rev-parse B:z/b >expect &&
3712
- test_cmp expect actual
3713
- fi &&
3520
+ test_path_is_missing .git/MERGE_HEAD &&
3521
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err &&
3522
3523
test_seq 1 10 >expected &&
3524
echo stuff >>expected &&
@@ -3766,34 +3574,9 @@ test_expect_success '11b: Avoid losing dirty file involved in directory rename'
3574
git checkout A^0 &&
3575
echo stuff >>z/c &&
3576
3769
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
3770
- then
3771
- test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
3772
- test_path_is_missing .git/MERGE_HEAD &&
3773
- test_grep "error: Your local changes to the following files would be overwritten by merge" err
3774
- else
3775
- git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
3776
- test_grep "Refusing to lose dirty file at z/c" out &&
3777
-
3778
- git ls-files -s >out &&
3779
- test_line_count = 3 out &&
3780
- git ls-files -u >out &&
3781
- test_line_count = 0 out &&
3782
- git ls-files -m >out &&
3783
- test_line_count = 0 out &&
3784
- git ls-files -o >out &&
3785
- test_line_count = 3 out &&
3786
-
3787
- git rev-parse >actual \
3788
- :0:x/b :0:y/a :0:y/c &&
3789
- git rev-parse >expect \
3790
- O:x/b O:z/a B:x/c &&
3791
- test_cmp expect actual &&
3792
-
3793
- git hash-object y/c >actual &&
3794
- git rev-parse B:x/c >expect &&
3795
- test_cmp expect actual
3796
- fi &&
3577
+ test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
3578
+ test_path_is_missing .git/MERGE_HEAD &&
3579
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err &&
3580
3581
grep -q stuff z/c &&
3582
test_seq 1 10 >expected &&
@@ -3850,13 +3633,8 @@ test_expect_success '11c: Avoid losing not-uptodate with rename + D/F conflict'
3633
echo stuff >>y/c &&
3634
3635
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
3853
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
3854
- then
3855
- test_path_is_missing .git/MERGE_HEAD &&
3856
- test_grep "error: Your local changes to the following files would be overwritten by merge" err
3857
- else
3858
- test_grep "following files would be overwritten by merge" err
3859
- fi &&
3636
+ test_path_is_missing .git/MERGE_HEAD &&
3637
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err &&
3638
3639
grep -q stuff y/c &&
3640
test_seq 1 10 >expected &&
@@ -3924,30 +3702,8 @@ test_expect_success '11d: Avoid losing not-uptodate with rename + D/F conflict'
3702
echo stuff >>z/c &&
3703
3704
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
3927
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
3928
- then
3929
- test_path_is_missing .git/MERGE_HEAD &&
3930
- test_grep "error: Your local changes to the following files would be overwritten by merge" err
3931
- else
3932
- test_grep "Refusing to lose dirty file at z/c" out &&
3933
-
3934
- git ls-files -s >out &&
3935
- test_line_count = 4 out &&
3936
- git ls-files -u >out &&
3937
- test_line_count = 1 out &&
3938
- git ls-files -o >out &&
3939
- test_line_count = 4 out &&
3940
-
3941
- git rev-parse >actual \
3942
- :0:x/b :0:y/a :0:y/c/d :3:y/c &&
3943
- git rev-parse >expect \
3944
- O:x/b O:z/a B:y/c/d B:x/c &&
3945
- test_cmp expect actual &&
3946
-
3947
- git hash-object y/c~HEAD >actual &&
3948
- git rev-parse B:x/c >expect &&
3949
- test_cmp expect actual
3950
- fi &&
3705
+ test_path_is_missing .git/MERGE_HEAD &&
3706
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err &&
3707
3708
grep -q stuff z/c &&
3709
test_seq 1 10 >expected &&
@@ -4010,39 +3766,8 @@ test_expect_success '11e: Avoid deleting not-uptodate with dir rename/rename(1to
3766
echo mods >>y/c &&
3767
3768
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
4013
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
4014
- then
4015
- test_path_is_missing .git/MERGE_HEAD &&
4016
- test_grep "error: Your local changes to the following files would be overwritten by merge" err
4017
- else
4018
- test_grep "CONFLICT (rename/rename)" out &&
4019
- test_grep "Refusing to lose dirty file at y/c" out &&
4020
-
4021
- git ls-files -s >out &&
4022
- test_line_count = 7 out &&
4023
- git ls-files -u >out &&
4024
- test_line_count = 4 out &&
4025
- git ls-files -o >out &&
4026
- test_line_count = 3 out &&
4027
-
4028
- git rev-parse >actual \
4029
- :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :2:y/c :3:y/c &&
4030
- git rev-parse >expect \
4031
- O:z/a O:z/b O:x/d O:x/c O:x/c A:y/c O:x/c &&
4032
- test_cmp expect actual &&
4033
-
4034
- # See if y/c~merged has expected contents; requires manually
4035
- # doing the expected file merge
4036
- git cat-file -p A:y/c >c1 &&
4037
- git cat-file -p B:z/c >c2 &&
4038
- >empty &&
4039
- test_must_fail git merge-file \
4040
- -L "HEAD" \
4041
- -L "" \
4042
- -L "B^0" \
4043
- c1 empty c2 &&
4044
- test_cmp c1 y/c~merged
4045
- fi &&
3769
+ test_path_is_missing .git/MERGE_HEAD &&
3770
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err &&
3771
3772
echo different >expected &&
3773
echo mods >>expected &&
@@ -4099,40 +3824,8 @@ test_expect_success '11f: Avoid deleting not-uptodate with dir rename/rename(2to
3824
echo important >>y/wham &&
3825
3826
test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
4102
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
4103
- then
4104
- test_path_is_missing .git/MERGE_HEAD &&
4105
- test_grep "error: Your local changes to the following files would be overwritten by merge" err
4106
- else
4107
- test_grep "CONFLICT (rename/rename)" out &&
4108
- test_grep "Refusing to lose dirty file at y/wham" out &&
4109
-
4110
- git ls-files -s >out &&
4111
- test_line_count = 4 out &&
4112
- git ls-files -u >out &&
4113
- test_line_count = 2 out &&
4114
- git ls-files -o >out &&
4115
- test_line_count = 3 out &&
4116
-
4117
- test_must_fail git rev-parse :1:y/wham &&
4118
-
4119
- git rev-parse >actual \
4120
- :0:y/a :0:y/b :2:y/wham :3:y/wham &&
4121
- git rev-parse >expect \
4122
- O:z/a O:z/b O:x/c O:x/d &&
4123
- test_cmp expect actual &&
4124
-
4125
- # Test that two-way merge in y/wham~merged is as expected
4126
- git cat-file -p :2:y/wham >expect &&
4127
- git cat-file -p :3:y/wham >other &&
4128
- >empty &&
4129
- test_must_fail git merge-file \
4130
- -L "HEAD" \
4131
- -L "" \
4132
- -L "B^0" \
4133
- expect empty other &&
4134
- test_cmp expect y/wham~merged
4135
- fi &&
3827
+ test_path_is_missing .git/MERGE_HEAD &&
3828
+ test_grep "error: Your local changes to the following files would be overwritten by merge" err &&
3829
3830
test_seq 1 10 >expected &&
3831
echo important >>expected &&
@@ -4267,7 +3960,7 @@ test_setup_12b1 () {
3960
)
3961
}
3962
4270
-test_expect_merge_algorithm failure success '12b1: Moving two directory hierarchies into each other' '
3963
+test_expect_success '12b1: Moving two directory hierarchies into each other' '
3964
test_setup_12b1 &&
3965
(
3966
cd 12b1 &&
@@ -4435,7 +4128,7 @@ test_setup_12c1 () {
4128
)
4129
}
4130
4438
-test_expect_merge_algorithm failure success '12c1: Moving one directory hierarchy into another w/ content merge' '
4131
+test_expect_success '12c1: Moving one directory hierarchy into another w/ content merge' '
4132
test_setup_12c1 &&
4133
(
4134
cd 12c1 &&
@@ -4797,7 +4490,7 @@ test_setup_12f () {
4490
)
4491
}
4492
4800
-test_expect_merge_algorithm failure success '12f: Trivial directory resolve, caching, all kinds of fun' '
4493
+test_expect_success '12f: Trivial directory resolve, caching, all kinds of fun' '
4494
test_setup_12f &&
4495
(
4496
cd 12f &&
@@ -5253,7 +4946,7 @@ test_setup_12l () {
4946
)
4947
}
4948
5256
-test_expect_merge_algorithm failure success '12l (B into A): Rename into each other + add/add conflict' '
4949
+test_expect_success '12l (B into A): Rename into each other + add/add conflict' '
4950
test_setup_12l BintoA &&
4951
(
4952
cd 12l_BintoA &&
@@ -5280,7 +4973,7 @@ test_expect_merge_algorithm failure success '12l (B into A): Rename into each ot
4973
)
4974
'
4975
5283
-test_expect_merge_algorithm failure success '12l (A into B): Rename into each other + add/add conflict' '
4976
+test_expect_success '12l (A into B): Rename into each other + add/add conflict' '
4977
test_setup_12l AintoB &&
4978
(
4979
cd 12l_AintoB &&
@@ -5348,7 +5041,7 @@ test_setup_12m () {
5041
)
5042
}
5043
5351
-test_expect_merge_algorithm failure success '12m: Change parent of renamed-dir to symlink on other side' '
5044
+test_expect_success '12m: Change parent of renamed-dir to symlink on other side' '
5045
test_setup_12m &&
5046
(
5047
cd 12m &&
t/t6424-merge-unrelated-index-changes.sh
+1
-3
@@ -296,10 +296,8 @@ test_expect_success 'with multiple strategies, recursive or ort failure do not e
296
git add a &&
297
git rev-parse :a >expect &&
298
299
- sane_unset GIT_TEST_MERGE_ALGORITHM &&
300
- test_must_fail git merge -s recursive -s ort -s octopus C^0 >output 2>&1 &&
299
+ test_must_fail git merge -s ort -s octopus C^0 >output 2>&1 &&
300
302
- grep "Trying merge strategy recursive..." output &&
301
grep "Trying merge strategy ort..." output &&
302
grep "Trying merge strategy octopus..." output &&
303
grep "No merge strategy handled the merge." output &&
t/t6426-merge-skip-unneeded-updates.sh
+1
-3
@@ -23,8 +23,6 @@ test_description="merge cases"
23
# files that might be renamed into each other's paths.)
24
25
. ./test-lib.sh
26
-. "$TEST_DIRECTORY"/lib-merge.sh
27
-
26
27
###########################################################################
28
# SECTION 1: Cases involving no renames (one side has subset of changes of
@@ -663,7 +661,7 @@ test_setup_4a () {
661
# correct requires doing the merge in-memory first, then realizing that no
662
# updates to the file are necessary, and thus that we can just leave the path
663
# alone.
666
-test_expect_merge_algorithm failure success '4a: Change on A, change on B subset of A, dirty mods present' '
664
+test_expect_success '4a: Change on A, change on B subset of A, dirty mods present' '
665
test_setup_4a &&
666
(
667
cd 4a &&
t/t6428-merge-conflicts-sparse.sh
-2
@@ -23,8 +23,6 @@ test_description="merge cases"
23
# files that might be renamed into each other's paths.)
24
25
. ./test-lib.sh
26
-. "$TEST_DIRECTORY"/lib-merge.sh
27
-
26
27
# Testcase basic, conflicting changes in 'numerals'
28
t/t6430-merge-recursive.sh
+1
-2
@@ -6,7 +6,6 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8
. ./test-lib.sh
9
-. "$TEST_DIRECTORY"/lib-merge.sh
9
10
test_expect_success 'setup 1' '
11
@@ -645,7 +644,7 @@ test_expect_success 'merge-recursive copy vs. rename' '
644
test_cmp expected actual
645
'
646
648
-test_expect_merge_algorithm failure success 'merge-recursive rename vs. rename/symlink' '
647
+test_expect_success 'merge-recursive rename vs. rename/symlink' '
648
649
git checkout -f rename &&
650
git merge rename-ln &&
t/t6436-merge-overwrite.sh
+4
-13
@@ -101,19 +101,10 @@ test_expect_success 'will not overwrite unstaged changes in renamed file' '
101
git mv c1.c other.c &&
102
git commit -m rename &&
103
cp important other.c &&
104
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
105
- then
106
- test_must_fail git merge c1a >out 2>err &&
107
- test_grep "would be overwritten by merge" err &&
108
- test_cmp important other.c &&
109
- test_path_is_missing .git/MERGE_HEAD
110
- else
111
- test_must_fail git merge c1a >out &&
112
- test_grep "Refusing to lose dirty file at other.c" out &&
113
- test_path_is_file other.c~HEAD &&
114
- test $(git hash-object other.c~HEAD) = $(git rev-parse c1a:c1.c) &&
115
- test_cmp important other.c
116
- fi
104
+ test_must_fail git merge c1a >out 2>err &&
105
+ test_grep "would be overwritten by merge" err &&
106
+ test_cmp important other.c &&
107
+ test_path_is_missing .git/MERGE_HEAD
108
'
109
110
test_expect_success 'will not overwrite untracked subtree' '
t/t6437-submodule-merge.sh
+20
-45
@@ -9,7 +9,6 @@ GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB=1
9
export GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB
10
11
. ./test-lib.sh
12
-. "$TEST_DIRECTORY"/lib-merge.sh
12
13
#
14
# history
@@ -110,14 +109,10 @@ test_expect_success 'merging should conflict for non fast-forward' '
109
test_when_finished "git -C merge-search reset --hard" &&
110
(cd merge-search &&
111
git checkout -b test-nonforward-a b &&
113
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
114
- then
115
- test_must_fail git merge c 2>actual &&
116
- sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
117
- grep "$sub_expect" actual
118
- else
119
- test_must_fail git merge c 2> actual
120
- fi)
112
+ test_must_fail git merge c 2>actual &&
113
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
114
+ grep "$sub_expect" actual
115
+ )
116
'
117
118
test_expect_success 'finish setup for merge-search' '
@@ -151,14 +146,9 @@ test_expect_success 'merging should conflict for non fast-forward (resolution ex
146
git checkout -b test-nonforward-b b &&
147
(cd sub &&
148
git rev-parse --short sub-d > ../expect) &&
154
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
155
- then
156
- test_must_fail git merge c >actual 2>sub-actual &&
157
- sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
158
- grep "$sub_expect" sub-actual
159
- else
160
- test_must_fail git merge c 2> actual
161
- fi &&
149
+ test_must_fail git merge c >actual 2>sub-actual &&
150
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
151
+ grep "$sub_expect" sub-actual &&
152
grep $(cat expect) actual > /dev/null &&
153
git reset --hard)
154
'
@@ -169,23 +159,12 @@ test_expect_success 'merging should fail for ambiguous common parent' '
159
(cd sub &&
160
git checkout -b ambiguous sub-b &&
161
git merge sub-c &&
172
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
173
- then
174
- git rev-parse --short sub-d >../expect1 &&
175
- git rev-parse --short ambiguous >../expect2
176
- else
177
- git rev-parse sub-d > ../expect1 &&
178
- git rev-parse ambiguous > ../expect2
179
- fi
162
+ git rev-parse --short sub-d >../expect1 &&
163
+ git rev-parse --short ambiguous >../expect2
164
) &&
181
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
182
- then
183
- test_must_fail git merge c >actual 2>sub-actual &&
184
- sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
185
- grep "$sub_expect" sub-actual
186
- else
187
- test_must_fail git merge c 2> actual
188
- fi &&
165
+ test_must_fail git merge c >actual 2>sub-actual &&
166
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
167
+ grep "$sub_expect" sub-actual &&
168
grep $(cat expect1) actual > /dev/null &&
169
grep $(cat expect2) actual > /dev/null &&
170
git reset --hard)
@@ -227,11 +206,9 @@ test_expect_success 'merging should fail for changes that are backwards' '
206
207
git checkout -b test-backward e &&
208
test_must_fail git merge f 2>actual &&
230
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
231
- then
232
- sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-d)" &&
233
- grep "$sub_expect" actual
234
- fi)
209
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-d)" &&
210
+ grep "$sub_expect" actual
211
+ )
212
'
213
214
@@ -358,7 +335,7 @@ test_expect_success 'setup file/submodule conflict' '
335
)
336
'
337
361
-test_expect_merge_algorithm failure success 'file/submodule conflict' '
338
+test_expect_success 'file/submodule conflict' '
339
test_when_finished "git -C file-submodule reset --hard" &&
340
(
341
cd file-submodule &&
@@ -467,7 +444,7 @@ test_expect_failure 'directory/submodule conflict; keep submodule clean' '
444
)
445
'
446
470
-test_expect_merge_algorithm failure success !FAIL_PREREQS 'directory/submodule conflict; should not treat submodule files as untracked or in the way' '
447
+test_expect_success !FAIL_PREREQS 'directory/submodule conflict; should not treat submodule files as untracked or in the way' '
448
test_when_finished "git -C directory-submodule/path reset --hard" &&
449
test_when_finished "git -C directory-submodule reset --hard" &&
450
(
@@ -535,11 +512,9 @@ test_expect_success 'merging should fail with no merge base' '
512
git add sub &&
513
git commit -m "b" &&
514
test_must_fail git merge a 2>actual &&
538
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
539
- then
540
- sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short HEAD^1)" &&
541
- grep "$sub_expect" actual
542
- fi)
515
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short HEAD^1)" &&
516
+ grep "$sub_expect" actual
517
+ )
518
'
519
520
test_done
t/t6438-submodule-directory-file-conflicts.sh
-5
@@ -12,11 +12,6 @@ test_submodule_switch "merge --ff"
12
13
test_submodule_switch "merge --ff-only"
14
15
-if test "$GIT_TEST_MERGE_ALGORITHM" != ort
16
-then
17
- KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
18
- KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
19
-fi
15
test_submodule_switch "merge --no-ff"
16
17
test_done
t/t6439-merge-co-error-msgs.sh
+1
-1
@@ -47,7 +47,7 @@ test_expect_success 'untracked files overwritten by merge (fast and non-fast for
47
export GIT_MERGE_VERBOSITY &&
48
test_must_fail git merge branch 2>out2
49
) &&
50
- echo "Merge with strategy ${GIT_TEST_MERGE_ALGORITHM:-ort} failed." >>expect &&
50
+ echo "Merge with strategy ort failed." >>expect &&
51
test_cmp out2 expect &&
52
git reset --hard HEAD^
53
'
t/t7402-submodule-rebase.sh
+2
-5
@@ -124,11 +124,8 @@ test_expect_success 'rebasing submodule that should conflict' '
124
echo "160000 $(git rev-parse HEAD) 3 submodule"
125
) >expect &&
126
test_cmp expect actual &&
127
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
128
- then
129
- sub_expect="go to submodule (submodule), and either merge commit $(git -C submodule rev-parse --short HEAD^0)" &&
130
- grep "$sub_expect" actual_output
131
- fi
127
+ sub_expect="go to submodule (submodule), and either merge commit $(git -C submodule rev-parse --short HEAD^0)" &&
128
+ grep "$sub_expect" actual_output
129
'
130
131
test_done
t/t7602-merge-octopus-many.sh
+3
-6
@@ -77,12 +77,9 @@ Merge made by the 'recursive' strategy.
77
EOF
78
79
test_expect_success 'merge reduces irrelevant remote heads' '
80
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
81
- then
82
- mv expected expected.tmp &&
83
- sed s/recursive/ort/ expected.tmp >expected &&
84
- rm expected.tmp
85
- fi &&
80
+ mv expected expected.tmp &&
81
+ sed s/recursive/ort/ expected.tmp >expected &&
82
+ rm expected.tmp &&
83
GIT_MERGE_VERBOSITY=0 git merge c4 c5 >actual &&
84
test_cmp expected actual
85
'
t/t7610-mergetool.sh
+11
-29
@@ -535,14 +535,9 @@ test_expect_success 'file vs modified submodule' '
535
yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
536
yes "" | git mergetool both &&
537
yes "d" | git mergetool file11 file12 &&
538
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
539
- then
540
- yes "c" | git mergetool submod~HEAD &&
541
- git rm submod &&
542
- git mv submod~HEAD submod
543
- else
544
- yes "l" | git mergetool submod
545
- fi &&
538
+ yes "c" | git mergetool submod~HEAD &&
539
+ git rm submod &&
540
+ git mv submod~HEAD submod &&
541
git submodule update -N &&
542
echo "not a submodule" >expect &&
543
test_cmp expect submod &&
@@ -559,15 +554,10 @@ test_expect_success 'file vs modified submodule' '
554
yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
555
yes "" | git mergetool both &&
556
yes "d" | git mergetool file11 file12 &&
562
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
563
- then
564
- mv submod submod.orig &&
565
- git rm --cached submod &&
566
- yes "c" | git mergetool submod~test19 &&
567
- git mv submod~test19 submod
568
- else
569
- yes "r" | git mergetool submod
570
- fi &&
557
+ mv submod submod.orig &&
558
+ git rm --cached submod &&
559
+ yes "c" | git mergetool submod~test19 &&
560
+ git mv submod~test19 submod &&
561
test -d submod.orig &&
562
git submodule update -N &&
563
echo "not a submodule" >expect &&
@@ -585,10 +575,7 @@ test_expect_success 'file vs modified submodule' '
575
yes "" | git mergetool both &&
576
yes "d" | git mergetool file11 file12 &&
577
yes "l" | git mergetool submod &&
588
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
589
- then
590
- yes "d" | git mergetool submod~test19
591
- fi &&
578
+ yes "d" | git mergetool submod~test19 &&
579
echo "main submodule" >expect &&
580
test_cmp expect submod/bar &&
581
git submodule update -N &&
@@ -686,14 +673,9 @@ test_expect_success 'directory vs modified submodule' '
673
test_must_fail git merge main &&
674
test -n "$(git ls-files -u)" &&
675
test ! -e submod.orig &&
689
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
690
- then
691
- yes "r" | git mergetool submod~main &&
692
- git mv submod submod.orig &&
693
- git mv submod~main submod
694
- else
695
- yes "r" | git mergetool submod
696
- fi &&
676
+ yes "r" | git mergetool submod~main &&
677
+ git mv submod submod.orig &&
678
+ git mv submod~main submod &&
679
test -d submod.orig &&
680
echo "not a submodule" >expect &&
681
test_cmp expect submod.orig/file16 &&
t/test-lib.sh
-2
@@ -544,8 +544,6 @@ GIT_DEFAULT_HASH="${GIT_TEST_DEFAULT_HASH:-sha1}"
544
export GIT_DEFAULT_HASH
545
GIT_DEFAULT_REF_FORMAT="${GIT_TEST_DEFAULT_REF_FORMAT:-files}"
546
export GIT_DEFAULT_REF_FORMAT
547
-GIT_TEST_MERGE_ALGORITHM="${GIT_TEST_MERGE_ALGORITHM:-ort}"
548
-export GIT_TEST_MERGE_ALGORITHM
547
548
# Tests using GIT_TRACE typically don't want <timestamp> <file>:<line> output
549
GIT_TRACE_BARE=1