summaryrefslogtreecommitdiff
path: root/builtin/merge.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-08-30 16:06:01 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-08-30 16:06:01 -0700
commit8778fa8b4f18a3930101825e5bcff62b5348e918 (patch)
tree309f07c553653f8f1c2c84b5b506ed47ee48a494 /builtin/merge.c
parentMerge branch 'en/merge-strategy-docs' (diff)
parentUpdate docs for change of default merge backend (diff)
downloadtgif-8778fa8b4f18a3930101825e5bcff62b5348e918.tar.xz
Merge branch 'en/ort-becomes-the-default'
Use `ort` instead of `recursive` as the default merge strategy. * en/ort-becomes-the-default: Update docs for change of default merge backend Change default merge backend from recursive to ort
Diffstat (limited to 'builtin/merge.c')
-rw-r--r--builtin/merge.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 8d00fa6a9f..ec8ff88a33 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -88,9 +88,9 @@ static int autostash;
static int no_verify;
static struct strategy all_strategy[] = {
- { "recursive", DEFAULT_TWOHEAD | NO_TRIVIAL },
+ { "recursive", NO_TRIVIAL },
{ "octopus", DEFAULT_OCTOPUS },
- { "ort", NO_TRIVIAL },
+ { "ort", DEFAULT_TWOHEAD | NO_TRIVIAL },
{ "resolve", 0 },
{ "ours", NO_FAST_FORWARD | NO_TRIVIAL },
{ "subtree", NO_FAST_FORWARD | NO_TRIVIAL },
@@ -1485,6 +1485,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
fast_forward = FF_NO;
}
+ if (!use_strategies && !pull_twohead &&
+ remoteheads && !remoteheads->next) {
+ char *default_strategy = getenv("GIT_TEST_MERGE_ALGORITHM");
+ if (default_strategy)
+ append_strategy(get_strategy(default_strategy));
+ }
if (!use_strategies) {
if (!remoteheads)
; /* already up-to-date */