diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-11-18 13:32:53 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-18 13:32:53 -0800 |
commit | a1f95951efc55c97477e32287b06e204553be5c2 (patch) | |
tree | 65bda8319dd00e2e2bab2a2a4d77ca1e8f41944a /builtin/rebase.c | |
parent | Merge branch 'ds/maintenance-part-3' (diff) | |
parent | merge,rebase,revert: select ort or recursive by config or environment (diff) | |
download | tgif-a1f95951efc55c97477e32287b06e204553be5c2.tar.xz |
Merge branch 'en/merge-ort-api-null-impl'
Preparation for a new merge strategy.
* en/merge-ort-api-null-impl:
merge,rebase,revert: select ort or recursive by config or environment
fast-rebase: demonstrate merge-ort's API via new test-tool command
merge-ort-wrappers: new convience wrappers to mimic the old merge API
merge-ort: barebones API of new merge strategy with empty implementation
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r-- | builtin/rebase.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c index 4bd9f257b9..19c7b377aa 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: |