Skip to content

Commit e828908

Browse files
peffgitster
authored andcommitted
t0005: test git exit code from signal death
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 239222f commit e828908

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

t/t0005-signals.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,11 @@ test_expect_success 'sigchain works' '
2020
test_cmp expect actual
2121
'
2222

23+
test_expect_success 'signals are propagated using shell convention' '
24+
# we use exec here to avoid any sub-shell interpretation
25+
# of the exit code
26+
git config alias.sigterm "!exec test-sigchain" &&
27+
test_expect_code 143 git sigterm
28+
'
29+
2330
test_done

0 commit comments

Comments
 (0)