[v13,27/27] tests: add a special setup where stash.useBuiltin is off
diff mbox series

Message ID 20190225231631.30507-28-t.gummerer@gmail.com
State New
Headers show
  • Convert "git stash" to C builtin
Related show

Commit Message

Thomas Gummerer Feb. 25, 2019, 11:16 p.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

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,

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
 builtin/stash.c | 5 ++++-
 t/README        | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff mbox series

diff --git a/builtin/stash.c b/builtin/stash.c
index 49c6d7948a..1bfa24030c 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -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;
 			 "config", "--bool", "stash.usebuiltin", NULL);
diff --git a/t/README b/t/README
index 28711cc508..9187eeea8e 100644
--- 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_TEST_STASH_USE_BUILTIN=<boolean>, when false, disables the
+built-in version of git-stash. See 'stash.useBuiltin' in
 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