mirror of
https://github.com/git/git
synced 2024-09-12 21:04:12 +00:00
e828908aa9
When a sub-process dies with a signal, we convert the exit code to the shell convention of 128+sig. Callers of git may be relying on this behavior, so let's make sure it does not break. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
31 lines
577 B
Bash
Executable file
31 lines
577 B
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='signals work as we expect'
|
|
. ./test-lib.sh
|
|
|
|
cat >expect <<EOF
|
|
three
|
|
two
|
|
one
|
|
EOF
|
|
|
|
test_expect_success 'sigchain works' '
|
|
test-sigchain >actual
|
|
case "$?" in
|
|
143) true ;; # POSIX w/ SIGTERM=15
|
|
271) true ;; # ksh w/ SIGTERM=15
|
|
3) true ;; # Windows
|
|
*) false ;;
|
|
esac &&
|
|
test_cmp expect actual
|
|
'
|
|
|
|
test_expect_success 'signals are propagated using shell convention' '
|
|
# we use exec here to avoid any sub-shell interpretation
|
|
# of the exit code
|
|
git config alias.sigterm "!exec test-sigchain" &&
|
|
test_expect_code 143 git sigterm
|
|
'
|
|
|
|
test_done
|