Skip to content

Commit

Permalink
tests: add a special setup where stash.useBuiltin is off
Browse files Browse the repository at this point in the history
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
62c2393 (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: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
dscho committed Feb 14, 2019
1 parent b99a49e commit 59e7bbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion builtin/stash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,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);
Expand Down
4 changes: 4 additions & 0 deletions t/README
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,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
Expand Down

0 comments on commit 59e7bbc

Please sign in to comment.