Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t0005-signals.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t0005-signals.sh` 54 lines ยท 1258 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='signals work as we expect' 4 5 . ./test-lib.sh 6 7 cat >expect <actual; ret=$?; } && 15 { 16 # Signal death by raise() on Windows acts like exit(3), 17 # regardless of the signal number. So we must allow that 18 # as well as the normal signal check. 19 test_match_signal 15 "$ret" || 20 test "$ret" = 3 21 } && 22 test_cmp expect actual 23 ' 24 25 test_expect_success !MINGW 'signals are propagated using shell convention' ' 26 # we use exec here to avoid any sub-shell interpretation 27 # of the exit code 28 git config alias.sigterm "!exec test-tool sigchain" && 29 test_expect_code 143 git sigterm 30 ' 31 32 large_git () { 33 for i in $(test_seq 1 100) 34 do 35 git diff --cached --binary || return 36 done 37 } 38 39 test_expect_success 'create blob' ' 40 test-tool genrandom foo 16384 >file && 41 git add file 42 ' 43 44 test_expect_success !MINGW 'a constipated git dies with SIGPIPE' ' 45 OUT=$( ((large_git && echo 0 1>&3 || echo $? 1>&3) | :) 3>&1 ) && 46 test_match_signal 13 "$OUT" 47 ' 48 49 test_expect_success !MINGW 'a constipated git dies with SIGPIPE even if parent ignores it' ' 50 OUT=$( ((trap "" PIPE && large_git && echo 0 1>&3 || echo $? 1>&3) | :) 3>&1 ) && 51 test_match_signal 13 "$OUT" 52 ' 53 54 test_done