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 03c39b3458 (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 03c39b3458 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 03c39b3458 forgot to negate 'test_match_signal's exit status in the condition. This patch fixes both issues. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

SZEDER Gábor committed Nov 26, 2018 at 21:03 UTC 4c2eb06419e95554b3530c618b55c5cdc687f621
1 file changed +1 -1
t/lib-git-daemon.sh
+1 -1
@@ -92,7 +92,7 @@ stop_git_daemon() {
92 kill "$GIT_DAEMON_PID"
93 wait "$GIT_DAEMON_PID" >&3 2>&4
94 ret=$?
95 - if test_match_signal 15 $?
95 + if ! test_match_signal 15 $ret
96 then
97 error "git daemon exited with status: $ret"
98 fi