Skip to content

Commit bf2d462

Browse files
committed
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>
1 parent 5dce909 commit bf2d462

File tree

3 files changed

+1
-20
lines changed

3 files changed

+1
-20
lines changed

Diff for: builtin/merge.c

+1-13
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static struct strategy *get_strategy(const char *name)
170170
struct strategy *ret;
171171
static struct cmdnames main_cmds = {0}, other_cmds = {0};
172172
static int loaded;
173-
char *default_strategy = getenv("GIT_TEST_MERGE_ALGORITHM");
173+
char *default_strategy = NULL;
174174

175175
if (!name)
176176
return NULL;
@@ -1311,12 +1311,6 @@ int cmd_merge(int argc,
13111311
if (branch)
13121312
skip_prefix(branch, "refs/heads/", &branch);
13131313

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-
13201314
init_diff_ui_defaults();
13211315
git_config(git_merge_config, NULL);
13221316

@@ -1517,12 +1511,6 @@ int cmd_merge(int argc,
15171511
fast_forward = FF_NO;
15181512
}
15191513

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-
}
15261514
if (!use_strategies) {
15271515
if (!remoteheads)
15281516
; /* already up-to-date */

Diff for: builtin/rebase.c

-5
Original file line numberDiff line numberDiff line change
@@ -1575,11 +1575,6 @@ int cmd_rebase(int argc,
15751575
options.default_backend);
15761576
}
15771577

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-
15831578
switch (options.type) {
15841579
case REBASE_MERGE:
15851580
options.state_dir = merge_dir();

Diff for: builtin/revert.c

-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,6 @@ static int run_sequencer(int argc, const char **argv, const char *prefix,
252252
free(opts->strategy);
253253
opts->strategy = xstrdup_or_null(strategy);
254254
}
255-
if (!opts->strategy && getenv("GIT_TEST_MERGE_ALGORITHM"))
256-
opts->strategy = xstrdup(getenv("GIT_TEST_MERGE_ALGORITHM"));
257255
free(options);
258256

259257
if (cmd == 'q') {

0 commit comments

Comments
 (0)