Skip to content

Commit c8c35f6

Browse files
newrengitster
authored andcommitted
merge tests: expect slight differences in output for recursive vs. ort
The ort merge strategy has some slight differences in commit descriptions (shortened hashes), stdout vs stderr, and in conflict messages. Also, builtin/merge.c reports usage of "ort" as "Merge made by the 'ort' strategy" -- while it is meant as a drop in replacement for "recursive" it is not yet treated as though it is recursive. Update the testcases to expect different output for the different merge backends. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c12d1f2 commit c8c35f6

File tree

3 files changed

+39
-6
lines changed

3 files changed

+39
-6
lines changed

t/t6402-merge-rename.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,12 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' '
320320
321321
test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
322322
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 &&
324329
325330
test 3 -eq "$(git ls-files -u | wc -l)" &&
326331
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' '
342347
! grep "error: refusing to lose untracked file at" errors &&
343348
test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
344349
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 &&
346356
347357
test 3 -eq "$(git ls-files -u | wc -l)" &&
348358
test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&

t/t6437-submodule-merge.sh

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@ test_expect_success 'merging should conflict for non fast-forward' '
127127
git checkout -b test-nonforward b &&
128128
(cd sub &&
129129
git rev-parse sub-d > ../expect) &&
130-
test_must_fail git merge c 2> actual &&
130+
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
131+
then
132+
test_must_fail git merge c >actual
133+
else
134+
test_must_fail git merge c 2> actual
135+
fi &&
131136
grep $(cat expect) actual > /dev/null &&
132137
git reset --hard)
133138
'
@@ -138,9 +143,21 @@ test_expect_success 'merging should fail for ambiguous common parent' '
138143
(cd sub &&
139144
git checkout -b ambiguous sub-b &&
140145
git merge sub-c &&
141-
git rev-parse sub-d > ../expect1 &&
142-
git rev-parse ambiguous > ../expect2) &&
143-
test_must_fail git merge c 2> actual &&
146+
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
147+
then
148+
git rev-parse --short sub-d >../expect1 &&
149+
git rev-parse --short ambiguous >../expect2
150+
else
151+
git rev-parse sub-d > ../expect1 &&
152+
git rev-parse ambiguous > ../expect2
153+
fi
154+
) &&
155+
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
156+
then
157+
test_must_fail git merge c >actual
158+
else
159+
test_must_fail git merge c 2> actual
160+
fi &&
144161
grep $(cat expect1) actual > /dev/null &&
145162
grep $(cat expect2) actual > /dev/null &&
146163
git reset --hard)

t/t7602-merge-octopus-many.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ Merge made by the 'recursive' strategy.
7777
EOF
7878

7979
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 &&
8086
GIT_MERGE_VERBOSITY=0 git merge c4 c5 >actual &&
8187
test_i18ncmp expected actual
8288
'

0 commit comments

Comments
 (0)