mirror of
https://github.com/git/git.git
synced 2026-01-28 03:22:25 +00:00
sequencer (rebase -i): respect strategy/strategy_opts settings
The sequencer already has an idea about using different merge strategies. We just piggy-back on top of that, using rebase -i's own settings, when running the sequencer in interactive rebase mode. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
22
sequencer.c
22
sequencer.c
@@ -112,6 +112,8 @@ static GIT_PATH_FUNC(rebase_path_verbose, "rebase-merge/verbose")
|
||||
static GIT_PATH_FUNC(rebase_path_head_name, "rebase-merge/head-name")
|
||||
static GIT_PATH_FUNC(rebase_path_onto, "rebase-merge/onto")
|
||||
static GIT_PATH_FUNC(rebase_path_autostash, "rebase-merge/autostash")
|
||||
static GIT_PATH_FUNC(rebase_path_strategy, "rebase-merge/strategy")
|
||||
static GIT_PATH_FUNC(rebase_path_strategy_opts, "rebase-merge/strategy_opts")
|
||||
|
||||
/* We will introduce the 'interactive rebase' mode later */
|
||||
static inline int is_rebase_i(const struct replay_opts *opts)
|
||||
@@ -1407,6 +1409,26 @@ static int read_populate_opts(struct replay_opts *opts)
|
||||
if (file_exists(rebase_path_verbose()))
|
||||
opts->verbose = 1;
|
||||
|
||||
if (read_oneliner(&buf, rebase_path_strategy(), 0)) {
|
||||
opts->strategy =
|
||||
sequencer_entrust(opts,
|
||||
strbuf_detach(&buf, NULL));
|
||||
if (read_oneliner(&buf,
|
||||
rebase_path_strategy_opts(), 0)) {
|
||||
int i;
|
||||
opts->xopts_nr = split_cmdline(buf.buf,
|
||||
&opts->xopts);
|
||||
for (i = 0; i < opts->xopts_nr; i++)
|
||||
skip_prefix(opts->xopts[i], "--",
|
||||
&opts->xopts[i]);
|
||||
if (opts->xopts_nr)
|
||||
sequencer_entrust(opts,
|
||||
strbuf_detach(&buf, NULL));
|
||||
else
|
||||
strbuf_release(&buf);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user