Skip to content

Commit 73cb877

Browse files
sunshinecogitster
authored andcommitted
test-lib: fix non-functioning GIT_TEST_MAINT_SCHEDULER fallback
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 <[email protected]> Signed-of-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0d1bd1d commit 73cb877

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/test-lib.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,6 +1937,7 @@ test_lazy_prereq SHA1 '
19371937
# Tests that verify the scheduler integration must set this locally
19381938
# to avoid errors.
19391939
GIT_TEST_MAINT_SCHEDULER="none:exit 1"
1940+
export GIT_TEST_MAINT_SCHEDULER
19401941

19411942
# Does this platform support `git fsmonitor--daemon`
19421943
#

0 commit comments

Comments
 (0)