]> git.ipfire.org Git - thirdparty/git.git/commitdiff
tests: add a special setup where stash.useBuiltin is off
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 25 Feb 2019 23:16:31 +0000 (23:16 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Mar 2019 00:41:40 +0000 (09:41 +0900)
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>
builtin/stash.c
t/README

index 49c6d7948a3285f1f70e414f03ad7732028e9583..1bfa24030c3efedde35d5a83091bedcf4db58923 100644 (file)
@@ -1515,7 +1515,10 @@ static int use_builtin_stash(void)
 {
        struct child_process cp = CHILD_PROCESS_INIT;
        struct strbuf out = STRBUF_INIT;
-       int ret;
+       int ret, env = git_env_bool("GIT_TEST_STASH_USE_BUILTIN", -1);
+
+       if (env != -1)
+               return env;
 
        argv_array_pushl(&cp.args,
                         "config", "--bool", "stash.usebuiltin", NULL);
index 28711cc508f9e5dfb2f2ef238be14926d56f9a12..9187eeea8ecc6364297f80559b931e8c19076343 100644 (file)
--- a/t/README
+++ b/t/README
@@ -349,6 +349,10 @@ GIT_TEST_REBASE_USE_BUILTIN=<boolean>, when false, disables the
 builtin version of git-rebase. See 'rebase.useBuiltin' in
 git-config(1).
 
+GIT_TEST_STASH_USE_BUILTIN=<boolean>, when false, disables the
+built-in version of git-stash. See 'stash.useBuiltin' in
+git-config(1).
+
 GIT_TEST_INDEX_THREADS=<n> enables exercising the multi-threaded loading
 of the index for the whole test suite by bypassing the default number of
 cache entries and thread minimums. Setting this to 1 will make the