[PATCH v2 07/11] rm tests: actually test for SIGPIPE in SIGPIPE test
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-01-16 17:14:48
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-01-16 17:14:48
Subsystem:
the rest · Maintainer:
Linus Torvalds
Change a test initially added in 50cd31c652 (t3600: comment on inducing SIGPIPE in `git rm`, 2019-11-27) to explicitly test for SIGPIPE using a pattern initially established in 7559a1be8a (unblock and unignore SIGPIPE, 2014-09-18). Signed-off-by: Ævar Arnfjörð Bjarmason <redacted> --- t/t3600-rm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index efec8d13b6..4f7e62d05c 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh@@ -250,8 +250,8 @@ test_expect_success 'choking "git rm" should not let it die with cruft' ' echo "100644 $hash 0 some-file-$i" i=$(( $i + 1 )) done | git update-index --index-info && - # git command is intentionally placed upstream of pipe to induce SIGPIPE - git rm -n "some-file-*" | : && + OUT=$( ((trap "" PIPE; git rm -n "some-file-*"; echo $? 1>&3) | :) 3>&1 ) && + test_match_signal 13 "$OUT" && test_path_is_missing .git/index.lock '
--
2.29.2.222.g5d2a92d10f8