Skip to content

Commit

Permalink
t0005: test git exit code from signal death
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jun 2, 2013
1 parent 239222f commit e828908
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions t/t0005-signals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e828908

Please sign in to comment.