Skip to content

Commit 2b8f449

Browse files
agrngitster
authored andcommitted
sequencer: use the "resolve" strategy without forking
This teaches the sequencer to invoke the "resolve" strategy with a function call instead of forking. Signed-off-by: Alban Gruin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e9346dd commit 2b8f449

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

sequencer.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "commit-reach.h"
3434
#include "rebase-interactive.h"
3535
#include "reset.h"
36+
#include "merge-strategies.h"
3637

3738
#define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION"
3839

@@ -2008,9 +2009,15 @@ static int do_pick_commit(struct repository *r,
20082009

20092010
commit_list_insert(base, &common);
20102011
commit_list_insert(next, &remotes);
2011-
res |= try_merge_command(r, opts->strategy,
2012-
opts->xopts_nr, (const char **)opts->xopts,
2013-
common, oid_to_hex(&head), remotes);
2012+
2013+
if (!strcmp(opts->strategy, "resolve")) {
2014+
repo_read_index(r);
2015+
res |= merge_strategies_resolve(r, common, oid_to_hex(&head), remotes);
2016+
} else
2017+
res |= try_merge_command(r, opts->strategy,
2018+
opts->xopts_nr, (const char **)opts->xopts,
2019+
common, oid_to_hex(&head), remotes);
2020+
20142021
free_commit_list(common);
20152022
free_commit_list(remotes);
20162023
}

0 commit comments

Comments
 (0)