builtin/{merge,rebase,revert}: remove GIT_TEST_MERGE_ALGORITHM

This environment variable existed to allow the testsuite to reuse all the merge-related tests in the testsuite while easily flipping between the 'recursive' and the 'ort' backends. Now that we have removed merge-recursive and remapped 'recursive' to mean 'ort', we don't need this scaffolding anymore. Remove it from these three builtins. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Apr 8, 2025 at 15:48 UTC 170e30d6957e1f7b8d88046ae122f98d57dca988
3 files changed +1 -20
builtin/merge.c
+1 -13
@@ -170,7 +170,7 @@ static struct strategy *get_strategy(const char *name)
170 struct strategy *ret;
171 static struct cmdnames main_cmds = {0}, other_cmds = {0};
172 static int loaded;
173 - char *default_strategy = getenv("GIT_TEST_MERGE_ALGORITHM");
173 + char *default_strategy = NULL;
174
175 if (!name)
176 return NULL;
@@ -1311,12 +1311,6 @@ int cmd_merge(int argc,
1311 if (branch)
1312 skip_prefix(branch, "refs/heads/", &branch);
1313
1314 - if (!pull_twohead) {
1315 - char *default_strategy = getenv("GIT_TEST_MERGE_ALGORITHM");
1316 - if (default_strategy && !strcmp(default_strategy, "ort"))
1317 - pull_twohead = xstrdup("ort");
1318 - }
1319 -
1314 init_diff_ui_defaults();
1315 git_config(git_merge_config, NULL);
1316
@@ -1517,12 +1511,6 @@ int cmd_merge(int argc,
1511 fast_forward = FF_NO;
1512 }
1513
1520 - if (!use_strategies && !pull_twohead &&
1521 - remoteheads && !remoteheads->next) {
1522 - char *default_strategy = getenv("GIT_TEST_MERGE_ALGORITHM");
1523 - if (default_strategy)
1524 - append_strategy(get_strategy(default_strategy));
1525 - }
1514 if (!use_strategies) {
1515 if (!remoteheads)
1516 ; /* already up-to-date */
builtin/rebase.c
-5
@@ -1575,11 +1575,6 @@ int cmd_rebase(int argc,
1575 options.default_backend);
1576 }
1577
1578 - if (options.type == REBASE_MERGE &&
1579 - !options.strategy &&
1580 - getenv("GIT_TEST_MERGE_ALGORITHM"))
1581 - options.strategy = xstrdup(getenv("GIT_TEST_MERGE_ALGORITHM"));
1582 -
1578 switch (options.type) {
1579 case REBASE_MERGE:
1580 options.state_dir = merge_dir();
builtin/revert.c
-2
@@ -252,8 +252,6 @@ static int run_sequencer(int argc, const char **argv, const char *prefix,
252 free(opts->strategy);
253 opts->strategy = xstrdup_or_null(strategy);
254 }
255 - if (!opts->strategy && getenv("GIT_TEST_MERGE_ALGORITHM"))
256 - opts->strategy = xstrdup(getenv("GIT_TEST_MERGE_ALGORITHM"));
255 free(options);
256
257 if (cmd == 'q') {