Skip to content

Commit

Permalink
tests: push: improve cleanup of HEAD tests
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Contreras authored and gitster committed Nov 30, 2020
1 parent b291b0a commit 12a30a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion t/t5516-fetch-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'
Expand All @@ -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 &&
Expand Down Expand Up @@ -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 &&
Expand Down

0 comments on commit 12a30a3

Please sign in to comment.