Subject: [PATCH 10/11] t5570: make test "set -e" clean

From: Junio C Hamano <[email-masked]>
Date: Tue, 24 Mar 2026 23:21:13 -0700

In order to catch mistakes like misspelling "test_expect_success",
we would like to eventually be able to run our test suite with the
"-e" option on.

Among a few scripts that use lib-git-daemon.sh, t5570 starts and
stops git-daemon process multiple times.  Make stop_git_daemon
function "set -e" clean.

Signed-off-by: Junio C Hamano <[email-masked]>
---
 t/lib-git-daemon.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh
index e62569222b..6850f08c1d 100644
--- a/t/lib-git-daemon.sh
+++ b/t/lib-git-daemon.sh
@@ -86,13 +86,13 @@ stop_git_daemon() {
 	# kill git-daemon child of git
 	say >&3 "Stopping git daemon ..."
 	kill "$GIT_DAEMON_PID"
-	wait "$GIT_DAEMON_PID" >&3 2>&4
-	ret=$?
+	ret=0
+	wait "$GIT_DAEMON_PID" >&3 2>&4 || ret=$?
 	if ! test_match_signal 15 $ret
 	then
 		error "git daemon exited with status: $ret"
 	fi
-	kill "$(cat "$GIT_DAEMON_PIDFILE")" 2>/dev/null
+	kill "$(cat "$GIT_DAEMON_PIDFILE")" 2>/dev/null || :
 	GIT_DAEMON_PID=
 	rm -f git_daemon_output "$GIT_DAEMON_PIDFILE"
 }
-- 
2.53.0-886-g529cbd14ff