Skip to content

Commit 75cd9ae

Browse files
newrengitster
authored andcommitted
merge, sequencer: switch recursive merges over to ort
More precisely, replace calls to merge_recursive() with merge_ort_recursive(). Also change t7615 to quit calling out recursive; it is not needed anymore, and we are in fact using ort now. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f7ca9bb commit 75cd9ae

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

builtin/merge.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include "rerere.h"
4040
#include "help.h"
4141
#include "merge.h"
42-
#include "merge-recursive.h"
4342
#include "merge-ort-wrappers.h"
4443
#include "resolve-undo.h"
4544
#include "remote.h"
@@ -750,12 +749,8 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
750749

751750
repo_hold_locked_index(the_repository, &lock,
752751
LOCK_DIE_ON_ERROR);
753-
if (!strcmp(strategy, "ort"))
754-
clean = merge_ort_recursive(&o, head, remoteheads->item,
755-
reversed, &result);
756-
else
757-
clean = merge_recursive(&o, head, remoteheads->item,
758-
reversed, &result);
752+
clean = merge_ort_recursive(&o, head, remoteheads->item,
753+
reversed, &result);
759754
free_commit_list(reversed);
760755
strbuf_release(&o.obuf);
761756

sequencer.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4319,20 +4319,13 @@ static int do_merge(struct repository *r,
43194319
o.branch2 = ref_name.buf;
43204320
o.buffer_output = 2;
43214321

4322-
if (!opts->strategy || !strcmp(opts->strategy, "ort")) {
4323-
/*
4324-
* TODO: Should use merge_incore_recursive() and
4325-
* merge_switch_to_result(), skipping the call to
4326-
* merge_switch_to_result() when we don't actually need to
4327-
* update the index and working copy immediately.
4328-
*/
4329-
ret = merge_ort_recursive(&o,
4330-
head_commit, merge_commit, bases,
4331-
&i);
4332-
} else {
4333-
ret = merge_recursive(&o, head_commit, merge_commit, bases,
4334-
&i);
4335-
}
4322+
/*
4323+
* TODO: Should use merge_incore_recursive() and
4324+
* merge_switch_to_result(), skipping the call to
4325+
* merge_switch_to_result() when we don't actually need to
4326+
* update the index and working copy immediately.
4327+
*/
4328+
ret = merge_ort_recursive(&o, head_commit, merge_commit, bases, &i);
43364329
if (ret <= 0)
43374330
fputs(o.obuf.buf, stdout);
43384331
strbuf_release(&o.obuf);
@@ -4343,7 +4336,7 @@ static int do_merge(struct repository *r,
43434336
goto leave_merge;
43444337
}
43454338
/*
4346-
* The return value of merge_recursive() is 1 on clean, and 0 on
4339+
* The return value of merge_ort_recursive() is 1 on clean, and 0 on
43474340
* unclean merge.
43484341
*
43494342
* Let's reverse that, so that do_merge() returns 0 upon success and

t/t7615-diff-algo-with-mergy-operations.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ test_expect_success 'setup' '
2222
git tag c2
2323
'
2424

25-
GIT_TEST_MERGE_ALGORITHM=recursive
26-
2725
test_expect_success 'merge c2 to c1 with recursive merge strategy fails with the current default myers diff algorithm' '
2826
git reset --hard c1 &&
2927
test_must_fail git merge -s recursive -Xdiff-algorithm=myers c2

0 commit comments

Comments
 (0)