]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7527: fix broken TAP output
authorPatrick Steinhardt <ps@pks.im>
Wed, 3 Jun 2026 05:39:44 +0000 (07:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Jun 2026 07:38:04 +0000 (16:38 +0900)
Before running the tests in t7527 we first verify whether the fsmonitor
even works, which seems to depend on the actual filesystem that is in
use. The verification executes outside of any prerequisite or test body,
so its stdout/stderr is not being redirected.

The consequence of this is that any command that prints to stdout/stderr
may break the TAP specification by printing invalid lines. And in fact
we already do that, as git-init(1) prints the path to the created Git
repository by default.

Fix this issue by moving the logic into a lazy prerequisite.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7527-builtin-fsmonitor.sh

index b63c162f9bac3fed6691770888cbd952b55a9026..d881e27466c18e3ba1bab54da830fb9f35790fe5 100755 (executable)
@@ -25,7 +25,8 @@ maybe_timeout () {
                "$@"
        fi
 }
-verify_fsmonitor_works () {
+
+test_lazy_prereq FSMONITOR_WORKS '
        git init test_fsmonitor_smoke || return 1
 
        GIT_TRACE_FSMONITOR="$PWD/smoke.trace" &&
@@ -50,9 +51,9 @@ verify_fsmonitor_works () {
        ret=$?
        rm -rf test_fsmonitor_smoke smoke.trace
        return $ret
-}
+'
 
-if ! verify_fsmonitor_works
+if ! test_have_prereq FSMONITOR_WORKS
 then
        skip_all="filesystem does not deliver fsmonitor events (container/overlayfs?)"
        test_done