diff mbox series

[v2,07/11] rm tests: actually test for SIGPIPE in SIGPIPE test

Message ID 20210116153554.12604-8-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series tests: add a bash "set -o pipefail" test mode | expand

Commit Message

Ævar Arnfjörð Bjarmason Jan. 16, 2021, 3:35 p.m. UTC
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 <avarab@gmail.com>
---
 t/t3600-rm.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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
 '