summaryrefslogtreecommitdiff
path: root/builtin/rebase.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r--builtin/rebase.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 4bd9f25..19c7b37 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -119,6 +119,7 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts)
struct replay_opts replay = REPLAY_OPTS_INIT;
replay.action = REPLAY_INTERACTIVE_REBASE;
+ replay.strategy = NULL;
sequencer_init_config(&replay);
replay.signoff = opts->signoff;
@@ -136,7 +137,12 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts)
opts->committer_date_is_author_date;
replay.ignore_date = opts->ignore_date;
replay.gpg_sign = xstrdup_or_null(opts->gpg_sign_opt);
- replay.strategy = opts->strategy;
+ if (opts->strategy)
+ replay.strategy = opts->strategy;
+ else if (!replay.strategy && replay.default_strategy) {
+ replay.strategy = replay.default_strategy;
+ replay.default_strategy = NULL;
+ }
if (opts->strategy_opts)
parse_strategy_opts(&replay, opts->strategy_opts);
@@ -1771,6 +1777,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
options.default_backend);
}
+ if (options.type == REBASE_MERGE &&
+ !options.strategy &&
+ getenv("GIT_TEST_MERGE_ALGORITHM"))
+ options.strategy = xstrdup(getenv("GIT_TEST_MERGE_ALGORITHM"));
+
switch (options.type) {
case REBASE_MERGE:
case REBASE_PRESERVE_MERGES: