]> git.scripts.mit.edu Git - git.git/commitdiff
t0005: test git exit code from signal death
authorJeff King <peff@peff.net>
Sat, 1 Jun 2013 17:24:41 +0000 (13:24 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 2 Jun 2013 20:47:54 +0000 (13:47 -0700)
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>
t/t0005-signals.sh

index 93e58c00e886db22b5ebf86af103efc4e65ec832..ad9e6047f2bbfa08b19968109b07664858da35e2 100755 (executable)
@@ -20,4 +20,11 @@ test_expect_success 'sigchain works' '
        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