Skip to content

Commit 4c2eb06

Browse files
szedergitster
authored andcommitted
t/lib-git-daemon: fix signal checking
Test scripts checking 'git daemon' stop the daemon with a TERM signal, and the 'stop_git_daemon' helper checks the daemon's exit status to make sure that it indeed died because of that signal. This check is bogus since 03c39b3 (t/lib-git-daemon: use test_match_signal, 2016-06-24), for two reasons: - Right after killing 'git daemon', 'stop_git_daemon' saves its exit status in a variable, but since 03c39b3 the condition checking the exit status looks at '$?', which at this point is not the exit status of 'git daemon', but that of the variable assignment, i.e. it's always 0. - The unexpected exit status should abort the whole test script with 'error', but it doesn't, because 03c39b3 forgot to negate 'test_match_signal's exit status in the condition. This patch fixes both issues. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 268fbcd commit 4c2eb06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/lib-git-daemon.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ stop_git_daemon() {
9292
kill "$GIT_DAEMON_PID"
9393
wait "$GIT_DAEMON_PID" >&3 2>&4
9494
ret=$?
95-
if test_match_signal 15 $?
95+
if ! test_match_signal 15 $ret
9696
then
9797
error "git daemon exited with status: $ret"
9898
fi

0 commit comments

Comments
 (0)