t7527: fix broken TAP output

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>

Patrick Steinhardt committed Jun 4, 2026 at 12:07 UTC bf3ed750cb4479db9e8193ae1937b2723054ce48
1 file changed +4 -3
t/t7527-builtin-fsmonitor.sh
+4 -3
@@ -25,7 +25,8 @@ maybe_timeout () {
25 "$@"
26 fi
27 }
28 -verify_fsmonitor_works () {
28 +
29 +test_lazy_prereq FSMONITOR_WORKS '
30 git init test_fsmonitor_smoke || return 1
31
32 GIT_TRACE_FSMONITOR="$PWD/smoke.trace" &&
@@ -50,9 +51,9 @@ verify_fsmonitor_works () {
51 ret=$?
52 rm -rf test_fsmonitor_smoke smoke.trace
53 return $ret
53 -}
54 +'
55
55 -if ! verify_fsmonitor_works
56 +if ! test_have_prereq FSMONITOR_WORKS
57 then
58 skip_all="filesystem does not deliver fsmonitor events (container/overlayfs?)"
59 test_done