Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2020-11-26 03:16:14 +0300
committerJunio C Hamano <gitster@pobox.com>2020-12-01 00:57:54 +0300
commit12a30a3ea65f1d27698927c5a871935f6c1223f9 (patch)
treec9b74de951419c2b510a6b2c5935ce2113cd441c /t/t5516-fetch-push.sh
parentb291b0a628020eedb10b6236d87fe25d295cea81 (diff)
tests: push: improve cleanup of HEAD tests
So that we are not left in an inconsistent state between them. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-xt/t5516-fetch-push.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index d11382f769..4077471937 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -449,6 +449,7 @@ test_expect_success 'push with HEAD nonexisting at remote' '
mk_test testrepo heads/master &&
git checkout -b local master &&
+ test_when_finished "git checkout master; git branch -D local" &&
git push testrepo HEAD &&
check_push_result testrepo $the_commit heads/local
'
@@ -457,8 +458,8 @@ test_expect_success 'push with +HEAD' '
mk_test testrepo heads/master &&
git checkout master &&
- git branch -D local &&
git checkout -b local &&
+ test_when_finished "git checkout master; git branch -D local" &&
git push testrepo master local &&
check_push_result testrepo $the_commit heads/master &&
check_push_result testrepo $the_commit heads/local &&
@@ -488,6 +489,7 @@ test_expect_success 'push with config remote.*.push = HEAD' '
mk_test testrepo heads/local &&
git checkout master &&
git branch -f local $the_commit &&
+ test_when_finished "git branch -D local" &&
(
cd testrepo &&
git checkout local &&