summaryrefslogtreecommitdiff
path: root/t/t3600-rm.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-02-12 22:21:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-02-12 22:21:04 (GMT)
commit2c873f97913994f8478a9078ff8b62e17378a0ed (patch)
tree339865bbaf42bb1c30a2d4999187417fd5926a5f /t/t3600-rm.sh
parentf0117958910fbc734457a83a9f8ecc3c62463417 (diff)
parentdb89a82b5b24fbe21ad273c8d8b442eef59aadd7 (diff)
downloadgit-2c873f97913994f8478a9078ff8b62e17378a0ed.zip
git-2c873f97913994f8478a9078ff8b62e17378a0ed.tar.gz
git-2c873f97913994f8478a9078ff8b62e17378a0ed.tar.bz2
Merge branch 'ab/tests-various-fixup'
Various test updates. * ab/tests-various-fixup: rm tests: actually test for SIGPIPE in SIGPIPE test archive tests: use a cheaper "zipinfo -h" invocation to get header upload-pack tests: avoid a non-zero "grep" exit status git-svn tests: rewrite brittle tests to use "--[no-]merges". git svn mergeinfo tests: refactor "test -z" to use test_must_be_empty git svn mergeinfo tests: modernize redirection & quoting style cache-tree tests: explicitly test HEAD and index differences cache-tree tests: use a sub-shell with less indirection cache-tree tests: remove unused $2 parameter cache-tree tests: refactor for modern test style
Diffstat (limited to 't/t3600-rm.sh')
-rwxr-xr-xt/t3600-rm.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index dff1228..7547f11 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -243,7 +243,7 @@ test_expect_success 'refresh index before checking if it is up-to-date' '
test_path_is_missing frotz/nitfol
'
-test_expect_success 'choking "git rm" should not let it die with cruft' '
+choke_git_rm_setup() {
git reset -q --hard &&
test_when_finished "rm -f .git/index.lock && git reset -q --hard" &&
i=0 &&
@@ -252,12 +252,24 @@ test_expect_success 'choking "git rm" should not let it die with cruft' '
do
echo "100644 $hash 0 some-file-$i"
i=$(( $i + 1 ))
- done | git update-index --index-info &&
+ done | git update-index --index-info
+}
+
+test_expect_success 'choking "git rm" should not let it die with cruft (induce SIGPIPE)' '
+ choke_git_rm_setup &&
# git command is intentionally placed upstream of pipe to induce SIGPIPE
git rm -n "some-file-*" | : &&
test_path_is_missing .git/index.lock
'
+
+test_expect_success !MINGW 'choking "git rm" should not let it die with cruft (induce and check SIGPIPE)' '
+ choke_git_rm_setup &&
+ 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
+'
+
test_expect_success 'Resolving by removal is not a warning-worthy event' '
git reset -q --hard &&
test_when_finished "rm -f .git/index.lock msg && git reset -q --hard" &&