git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] tests: git push mirror mode tests V2 -- add tag tests

From
Andy Whitcroft <apw@shadowen.org>
Date
Nov 9, 2007, 14:43 UTC
Message-ID
<1194619555.0@pinky>
In-Reply-To
<1194603673.0@pinky>

Add additional tests to the the V2 tests testing the handling of tags in --mirror mode. We expect these to be tracked in line with the master.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
	Note that this patch is cumulative on top of the following
	patch:
		tests: git push mirror mode tests V2
	These two patches together replace the 4/4 from the original
	series.
---
 t/t5517-push-mirror.sh |  105 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 104 insertions(+), 1 deletions(-)
diff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh
index a65d2f5..ec87ce5 100755
--- a/t/t5517-push-mirror.sh
+++ b/t/t5517-push-mirror.sh
@@ -30,6 +30,7 @@ mk_repo_pair () {
 }
 
 
+# BRANCH tests
 test_expect_success 'push mirror does not create new branches' '
 
 	mk_repo_pair &&
@@ -96,7 +97,7 @@ test_expect_success 'push mirror does not remove branches' '
 
 '
 
-test_expect_success 'push mirror does not add, update and remove together' '
+test_expect_success 'push mirror does not add, update and remove branches together' '
 
 	mk_repo_pair &&
 	(
@@ -122,4 +123,106 @@ test_expect_success 'push mirror does not add, update and remove together' '
 
 '
 
+
+# TAG tests
+test_expect_success 'push mirror does not create new tags' '
+
+	mk_repo_pair &&
+	(
+		cd master &&
+		echo one >foo && git add foo && git commit -m one &&
+		git tag -f tmaster master &&
+		git push --mirror up
+	) &&
+	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
+	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
+	test "$master_master" = "$mirror_master"
+
+'
+
+test_expect_success 'push mirror does not update existing tags' '
+
+	mk_repo_pair &&
+	(
+		cd master &&
+		echo one >foo && git add foo && git commit -m one &&
+		git tag -f tmaster master &&
+		git push --mirror up &&
+		echo two >foo && git add foo && git commit -m two &&
+		git tag -f tmaster master &&
+		git push --mirror up
+	) &&
+	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
+	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
+	test "$master_master" = "$mirror_master"
+
+'
+
+test_expect_success 'push mirror does not force update existing tags' '
+
+	mk_repo_pair &&
+	(
+		cd master &&
+		echo one >foo && git add foo && git commit -m one &&
+		git tag -f tmaster master &&
+		git push --mirror up &&
+		echo two >foo && git add foo && git commit -m two &&
+		git tag -f tmaster master &&
+		git push --mirror up &&
+		git reset --hard HEAD^
+		git tag -f tmaster master &&
+		git push --mirror up
+	) &&
+	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
+	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
+	test "$master_master" = "$mirror_master"
+
+'
+
+test_expect_success 'push mirror does not remove tags' '
+
+	mk_repo_pair &&
+	(
+		cd master &&
+		echo one >foo && git add foo && git commit -m one &&
+		git tag -f tremove master &&
+		git push --mirror up &&
+		git tag -d tremove
+		git push --mirror up 
+	) &&
+	(
+		cd mirror &&
+		invert git show-ref -s --verify refs/tags/tremove
+	)
+
+'
+
+test_expect_success 'push mirror does not add, update and remove tags together' '
+
+	mk_repo_pair &&
+	(
+		cd master &&
+		echo one >foo && git add foo && git commit -m one &&
+		git tag -f tmaster master &&
+		git tag -f tremove master &&
+		git push --mirror up &&
+		git tag -d tremove &&
+		git tag tadd master &&
+		echo two >foo && git add foo && git commit -m two &&
+		git tag -f tmaster master &&
+		git push --mirror up
+	) &&
+	master_master=$(cd master && git show-ref -s --verify refs/tags/tmaster) &&
+	master_add=$(cd master && git show-ref -s --verify refs/tags/tadd) &&
+	mirror_master=$(cd mirror && git show-ref -s --verify refs/tags/tmaster) &&
+	mirror_add=$(cd mirror && git show-ref -s --verify refs/tags/tadd) &&
+	test "$master_master" = "$mirror_master" &&
+	test "$master_add" = "$mirror_add" &&
+	(
+		cd mirror &&
+		invert git show-ref -s --verify refs/tags/tremove
+	)
+
+'
+
 test_done
Previous: Andy WhitcroftNext: Andy Whitcroft
Message 17 of 23 in “git push mirror mode”
  1. Andy WhitcroftNov 8, 2007
  2. 1/2 mirror pushingAndy Whitcroft, Nov 8, 2007
  3. 2/2 git-push: plumb in --mirror modeAndy Whitcroft, Nov 8, 2007
  4. Johannes SchindelinNov 8, 2007
  5. Andy WhitcroftNov 8, 2007
  6. Andreas EricssonNov 8, 2007
  7. Andy WhitcroftNov 8, 2007
  8. Andreas EricssonNov 8, 2007
  9. Andy WhitcroftNov 8, 2007
  10. Junio C HamanoNov 8, 2007
  11. 1/2 mirror pushingAndy Whitcroft, Nov 8, 2007
  12. Johannes SchindelinNov 8, 2007
  13. 2/2 git-push: plumb in --mirror modeAndy Whitcroft, Nov 8, 2007
  14. git push mirror mode V3Andy Whitcroft, Nov 8, 2007
  15. 4/4 tests: git push mirror mode testsAndy Whitcroft, Nov 8, 2007
  16. tests: git push mirror mode tests V2Andy Whitcroft, Nov 9, 2007
  17. tests: git push mirror mode tests V2 -- add tag testsAndy Whitcroft, Nov 9, 2007
  18. git-push: add documentation for the newly add --mirror modeAndy Whitcroft, Nov 9, 2007
  19. Junio C HamanoNov 9, 2007
  20. Andy WhitcroftNov 12, 2007
  21. 2/4 mirror pushing -- clean up match_refs flagsAndy Whitcroft, Nov 8, 2007
  22. 3/4 git-push: plumb in --mirror modeAndy Whitcroft, Nov 8, 2007
  23. 1/4 mirror pushingAndy Whitcroft, Nov 8, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.