]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test-lib: don't set GIT_EXIT_OK before calling test_atexit_handler
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 27 Jul 2022 23:13:30 +0000 (01:13 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Jul 2022 23:35:39 +0000 (16:35 -0700)
Change the control flow in test_done so that we'll set GIT_EXIT_OK=t
after we call test_atexit_handler(). This seems to have been a mistake
in 900721e15c4 (test-lib: introduce 'test_atexit', 2019-03-13). It
doesn't make sense to allow our "atexit" handling to call "exit"
without us emitting the errors we'll emit without GIT_EXIT_OK=t being
set.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh

index 3f11ce35112e2e03cdb1e2abe12ef77bce5f2753..c8c84ef9b146cdfcbba4c4439cac7a69974ab654 100644 (file)
@@ -1169,12 +1169,12 @@ test_atexit_handler () {
 }
 
 test_done () {
-       GIT_EXIT_OK=t
-
        # Run the atexit commands _before_ the trash directory is
        # removed, so the commands can access pidfiles and socket files.
        test_atexit_handler
 
+       GIT_EXIT_OK=t
+
        finalize_test_output
 
        if test -z "$HARNESS_ACTIVE"