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

[PATCH] t5543, atomic pushes: test deleting and renaming branches

From
Stefan Beller <sbeller@google.com>
Date
Jan 15, 2015, 20:45 UTC
Message-ID
<1421354720-13312-1-git-send-email-sbeller@google.com>

Add more test coverage to the atomic push option. It turns out there is a breakage when renaming branches within an atomic push. The breakage occurs because it cannot lock the refs v/v as well as x.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 t/t5543-atomic-push.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh
index 3480b33..96a106b 100755
--- a/t/t5543-atomic-push.sh
+++ b/t/t5543-atomic-push.sh
@@ -191,4 +191,53 @@ test_expect_success 'atomic push is not advertised if configured' '
 	test_refs master HEAD@{1}
 '
 
+test_expect_success 'atomic push handles deletes gracefully' '
+	mk_repo_pair &&
+	(
+		cd workbench &&
+		git checkout -b todelete &&
+		test_commit one &&
+		git push --mirror up
+	) &&
+	(
+		cd workbench &&
+		git checkout -b anotherbranch &&
+		git branch -D todelete &&
+		git push --mirror --atomic up
+	)
+'
+
+test_expect_failure 'atomic push handles renames gracefully' '
+	# First push to upstream having the following branches:
+	# v, x/x, x/y and y/z. Now rename them and push atomically:
+	# v   -> v/v (1)
+	# x/x -> x   (2)
+	# x/y -> y   (3)
+	# y/z -> z   (4)
+	# (1) and (2) test (directory/file) conflicts on the branch itself. (3)
+	# is testing the (D/F) conflict with another branch involved which is
+	# freed in (4)
+	mk_repo_pair &&
+	(
+		cd workbench &&
+		git checkout -b v &&
+		test_commit one &&
+		git checkout -b x/x &&
+		test_commit two &&
+		git checkout -b x/y &&
+		test_commit three &&
+		git checkout -b y/z &&
+		test_commit four &&
+		git push --mirror up
+	) &&
+	(
+		cd workbench &&
+		git branch -m y/z z &&
+		git branch -m x/y y &&
+		git branch -m x/x x &&
+		git branch -m v v/v &&
+		git push --atomic up :v :x/x :x/y :y/z v/v x y z
+	)
+'
+
 test_done
-- 
2.2.1.62.g3f15098
Message 1 of 1 in “t5543, atomic pushes: test deleting and renaming branches”
  1. t5543, atomic pushes: test deleting and renaming branchesStefan Beller, Jan 15, 2015

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.