summaryrefslogtreecommitdiff
path: root/t/t5801-remote-helpers.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-12-11 11:14:09 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-12-11 11:14:10 -0800
commit4cb5488fa6cd1dc3cea253e7d8df6bf9d945653b (patch)
treed5e6c90ac3e4223be3efed3e39d930971b367094 /t/t5801-remote-helpers.sh
parentDocumentation/git-update-index: add missing opts to synopsis (diff)
parenttest-lib-functions: detect test_when_finished in subshell (diff)
downloadtgif-4cb5488fa6cd1dc3cea253e7d8df6bf9d945653b.tar.xz
Merge branch 'jk/test-lint-forbid-when-finished-in-subshell' into maint
Because "test_when_finished" in our test framework queues the clean-up tasks to be done in a shell variable, it should not be used inside a subshell. Add a mechanism to allow 'bash' to catch such uses, and fix the ones that were found. * jk/test-lint-forbid-when-finished-in-subshell: test-lib-functions: detect test_when_finished in subshell t7800: don't use test_config in a subshell test-lib-functions: support "test_config -C <dir> ..." t5801: don't use test_when_finished in a subshell t7610: don't use test_config in a subshell
Diffstat (limited to 't/t5801-remote-helpers.sh')
-rwxr-xr-xt/t5801-remote-helpers.sh12
1 files changed, 4 insertions, 8 deletions
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index c9d3ed14c3..362b1581e0 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -242,13 +242,6 @@ clean_mark () {
sort >$(basename "$1")
}
-cmp_marks () {
- test_when_finished "rm -rf git.marks testgit.marks" &&
- clean_mark ".git/testgit/$1/git.marks" &&
- clean_mark ".git/testgit/$1/testgit.marks" &&
- test_cmp git.marks testgit.marks
-}
-
test_expect_success 'proper failure checks for fetching' '
(cd local &&
test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git fetch 2>error &&
@@ -258,12 +251,15 @@ test_expect_success 'proper failure checks for fetching' '
'
test_expect_success 'proper failure checks for pushing' '
+ test_when_finished "rm -rf local/git.marks local/testgit.marks" &&
(cd local &&
git checkout -b crash master &&
echo crash >>file &&
git commit -a -m crash &&
test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git push --all &&
- cmp_marks origin
+ clean_mark ".git/testgit/origin/git.marks" &&
+ clean_mark ".git/testgit/origin/testgit.marks" &&
+ test_cmp git.marks testgit.marks
)
'