git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: git@vger.kernel.org, gitster@pobox.com, mhagger@alumn.mit.edu
Cc: Stefan Beller <sbeller@google.com>
Subject: [PATCH] t5543, atomic pushes: test deleting and renaming branches
Date: Thu, 15 Jan 2015 12:45:20 -0800	[thread overview]
Message-ID: <1421354720-13312-1-git-send-email-sbeller@google.com> (raw)

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

                 reply	other threads:[~2015-01-15 20:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421354720-13312-1-git-send-email-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mhagger@alumn.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).