tests: add a special setup where rebase.useBuiltin is off
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 14 Nov 2018 09:15:06 +0000 (09:15 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Nov 2018 10:02:54 +0000 (19:02 +0900)
Add a GIT_TEST_REBASE_USE_BUILTIN=false test mode which is equivalent
to running with rebase.useBuiltin=false. This is needed to spot that
we're not introducing any regressions in the legacy rebase version
while we're carrying both it and the new builtin version.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c
t/README
index 0ee06aa3631ee89761d570b433994cc77302742e..68ad8c1149191750b8ddcd97d489587780231830 100644 (file)
@@ -48,7 +48,10 @@ static int use_builtin_rebase(void)
 {
        struct child_process cp = CHILD_PROCESS_INIT;
        struct strbuf out = STRBUF_INIT;
-       int ret;
+       int ret, env = git_env_bool("GIT_TEST_REBASE_USE_BUILTIN", -1);
+
+       if (env != -1)
+               return env;
 
        argv_array_pushl(&cp.args,
                         "config", "--bool", "rebase.usebuiltin", NULL);
index 242497455f4f448335f7170e7444e5a2f2ff6b7d..3df5d12e46ff994a18f5adf97a93c1f5aa766ec8 100644 (file)
--- a/t/README
+++ b/t/README
@@ -339,6 +339,10 @@ for the index version specified.  Can be set to any valid version
 GIT_TEST_PRELOAD_INDEX=<boolean> exercises the preload-index code path
 by overriding the minimum number of cache entries required per thread.
 
+GIT_TEST_REBASE_USE_BUILTIN=<boolean>, when false, disables the
+builtin version of git-rebase. See 'rebase.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