]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test-lib: fix non-functioning GIT_TEST_MAINT_SCHEDULER fallback
authorEric Sunshine <sunshine@sunshineco.com>
Fri, 29 Mar 2024 22:27:03 +0000 (18:27 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 31 Mar 2024 22:09:44 +0000 (15:09 -0700)
When environment variable GIT_TEST_MAINT_SCHEDULER is set, `git
maintenance` invokes the command specified as the variable's value
rather than invoking the actual underlying platform-specific scheduler
management command. By setting GIT_TEST_MAINT_SCHEDULER to some suitable
value, test authors can therefore validate behavior of "destructive"
`git maintenance` commands without having to worry about clobbering the
user's own local scheduler configuration.

In order to protect an absent-minded test author from forgetting to set
GIT_TEST_MAINT_SCHEDULER in the local test script (and thus clobbering
his or her own scheduler configuration), t/test-lib.sh assigns an
"immediately error-out" value to GIT_TEST_MAINT_SCHEDULER by default
which should ensure that the problem will be caught and reported before
any damage can be done to the configuration of the person running the
tests.

Unfortunately, however, t/test-lib.sh neglects to export
GIT_TEST_MAINT_SCHEDULER, which renders the default "error-out"
assignment worthless. Fix this by exporting the variable as
originally intended.

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-of-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh

index 62136caee5a961f1eb4569f2a92a2feef97fb18c..46e5c86f0435ee4bf914cd468a87f8087f7e7310 100644 (file)
@@ -1937,6 +1937,7 @@ test_lazy_prereq SHA1 '
 # Tests that verify the scheduler integration must set this locally
 # to avoid errors.
 GIT_TEST_MAINT_SCHEDULER="none:exit 1"
+export GIT_TEST_MAINT_SCHEDULER
 
 # Does this platform support `git fsmonitor--daemon`
 #