diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-09-29 22:17:20 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-29 22:17:20 -0700 |
commit | 131f0315c46c30d5a9e6743354808230cf4908c0 (patch) | |
tree | 6ea66a6881020352074d813761e7af5fd0d2ed27 /t | |
parent | Update draft release notes to 2.2 (diff) | |
parent | mingw.h: add dummy functions for sigset_t operations (diff) | |
download | tgif-131f0315c46c30d5a9e6743354808230cf4908c0.tar.xz |
Merge branch 'pr/use-default-sigpipe-setting'
We used to get confused when a process called us with SIGPIPE
ignored; we do want to die with SIGPIPE when the output is not
read by default, and do ignore the signal when appropriate.
* pr/use-default-sigpipe-setting:
mingw.h: add dummy functions for sigset_t operations
unblock and unignore SIGPIPE
Diffstat (limited to 't')
-rwxr-xr-x | t/t0005-signals.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t0005-signals.sh b/t/t0005-signals.sh index 981437b3a8..aeea50c633 100755 --- a/t/t0005-signals.sh +++ b/t/t0005-signals.sh @@ -27,4 +27,26 @@ test_expect_success !MINGW 'signals are propagated using shell convention' ' test_expect_code 143 git sigterm ' +large_git () { + for i in $(test_seq 1 100) + do + git diff --cached --binary || return + done +} + +test_expect_success 'create blob' ' + test-genrandom foo 16384 >file && + git add file +' + +test_expect_success !MINGW 'a constipated git dies with SIGPIPE' ' + OUT=$( ((large_git; echo $? 1>&3) | :) 3>&1 ) + test "$OUT" -eq 141 +' + +test_expect_success !MINGW 'a constipated git dies with SIGPIPE even if parent ignores it' ' + OUT=$( ((trap "" PIPE; large_git; echo $? 1>&3) | :) 3>&1 ) + test "$OUT" -eq 141 +' + test_done |