tests: add a special setup where stash.useBuiltin is off

Add a GIT_TEST_STASH_USE_BUILTIN=false test mode which is equivalent to running with stash.useBuiltin=false. This is needed to spot that we're not introducing any regressions in the legacy stash version while we're carrying both it and the new built-in version. This imitates the equivalent treatment for the built-in rebase in 62c23938fae5 (tests: add a special setup where rebase.useBuiltin is off, 2018-11-14). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Feb 25, 2019 at 23:16 UTC 7906af0cb84c8e65656347909abd4e22b04d1c1e
2 files changed +8 -1
builtin/stash.c
+4 -1
@@ -1515,7 +1515,10 @@ static int use_builtin_stash(void)
1515 {
1516 struct child_process cp = CHILD_PROCESS_INIT;
1517 struct strbuf out = STRBUF_INIT;
1518 - int ret;
1518 + int ret, env = git_env_bool("GIT_TEST_STASH_USE_BUILTIN", -1);
1519 +
1520 + if (env != -1)
1521 + return env;
1522
1523 argv_array_pushl(&cp.args,
1524 "config", "--bool", "stash.usebuiltin", NULL);
t/README
+4
@@ -349,6 +349,10 @@ GIT_TEST_REBASE_USE_BUILTIN=<boolean>, when false, disables the
349 builtin version of git-rebase. See 'rebase.useBuiltin' in
350 git-config(1).
351
352 +GIT_TEST_STASH_USE_BUILTIN=<boolean>, when false, disables the
353 +built-in version of git-stash. See 'stash.useBuiltin' in
354 +git-config(1).
355 +
356 GIT_TEST_INDEX_THREADS=<n> enables exercising the multi-threaded loading
357 of the index for the whole test suite by bypassing the default number of
358 cache entries and thread minimums. Setting this to 1 will make the