summaryrefslogtreecommitdiff
path: root/t/lib-git-daemon.sh
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2018-11-26 20:03:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-27 00:53:58 (GMT)
commit4c2eb06419e95554b3530c618b55c5cdc687f621 (patch)
tree19b11fc5598e49545580107cc0e8d82825de3817 /t/lib-git-daemon.sh
parent268fbcd172cdb306e8a3e7143cc16677c963d6cd (diff)
downloadgit-4c2eb06419e95554b3530c618b55c5cdc687f621.zip
git-4c2eb06419e95554b3530c618b55c5cdc687f621.tar.gz
git-4c2eb06419e95554b3530c618b55c5cdc687f621.tar.bz2
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>
Diffstat (limited to 't/lib-git-daemon.sh')
-rw-r--r--t/lib-git-daemon.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh
index edbea2d..f98de95 100644
--- a/t/lib-git-daemon.sh
+++ b/t/lib-git-daemon.sh
@@ -92,7 +92,7 @@ stop_git_daemon() {
kill "$GIT_DAEMON_PID"
wait "$GIT_DAEMON_PID" >&3 2>&4
ret=$?
- if test_match_signal 15 $?
+ if ! test_match_signal 15 $ret
then
error "git daemon exited with status: $ret"
fi