diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-07-22 11:24:02 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-07-22 11:24:03 -0700 |
commit | a0c1aa216130680f890ded9e057bae24b0610d98 (patch) | |
tree | f1141f4b0266492021c0eafb3c5e8882b06db363 /t | |
parent | d3aeb31dc410a71ee41b87328f0d71996417294f (diff) | |
parent | 4783e7ea83e39f19e0ef03372fd721f159d1f1de (diff) | |
download | git-a0c1aa216130680f890ded9e057bae24b0610d98.tar.gz |
Merge branch 'jk/t0008-sigpipe-fix'
Fix for recent test breakage on 'master'.
* jk/t0008-sigpipe-fix:
t0008: avoid SIGPIPE race condition on fifo
Diffstat (limited to 't')
-rwxr-xr-x | t/t0008-ignores.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh index a56db804cb..c29342d6bc 100755 --- a/t/t0008-ignores.sh +++ b/t/t0008-ignores.sh @@ -697,13 +697,21 @@ test_expect_success PIPE 'streaming support for --stdin' ' # shell, and then echo to the fd. We make sure to close it at # the end, so that the subprocess does get EOF and dies # properly. + # + # Similarly, we must keep "out" open so that check-ignore does + # not ever get SIGPIPE trying to write to us. Not only would that + # produce incorrect results, but then there would be no writer on the + # other end of the pipe, and we would potentially block forever trying + # to open it. exec 9>in && + exec 8<out && test_when_finished "exec 9>&-" && + test_when_finished "exec 8<&-" && echo >&9 one && - read response <out && + read response <&8 && echo "$response" | grep "^\.gitignore:1:one one" && echo >&9 two && - read response <out && + read response <&8 && echo "$response" | grep "^:: two" ' |