Subject: [PATCH 2/8] push tests: fix logic error in "push" test assertion

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Sun, 29 Apr 2018 20:20:54 +0000

Fix a logic error that's been here since this test was added in
dbfeddb12e ("push: require force for refs under refs/tags/",
2012-11-29).

The intent of this test is to force-create a new tag pointing to
HEAD~, and then assert that pushing it doesn't work without --force.

Instead, the code was not creating a new tag at all, and then failing
to push the previous tag for the unrelated reason of providing a
refspec that doesn't make any sense.

Signed-off-by: Ævar Arnfjörð Bjarmason <[email-masked]>
---
 t/t5516-fetch-push.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 7b5a553398..15c8d5a734 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -979,8 +979,8 @@ test_expect_success 'push requires --force to update lightweight tag' '
 		git tag -f Tag &&
 		test_must_fail git push ../child2 Tag &&
 		git push --force ../child2 Tag &&
-		git tag -f Tag &&
-		test_must_fail git push ../child2 Tag HEAD~ &&
+		git tag -f Tag HEAD~ &&
+		test_must_fail git push ../child2 Tag &&
 		git push --force ../child2 Tag
 	)
 '
-- 
2.17.0.290.gded63e768a