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

[PATCH v7 9/9] replace: add test for --graft with a mergetag

From
Christian Couder <chriscool@tuxfamily.org>
Date
Jul 19, 2014, 15:01 UTC
Message-ID
<20140719150116.9564.10746.chriscool@tuxfamily.org>
In-Reply-To
<20140719145951.9564.61331.chriscool@tuxfamily.org>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 t/t6050-replace.sh | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index cebab63..4d5a25e 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -418,4 +418,26 @@ test_expect_success GPG '--graft with a signed commit' '
 	git replace -d $HASH8
 '
 
+test_expect_success GPG 'set up a merge commit with a mergetag' '
+	git reset --hard HEAD &&
+	git checkout -b test_branch HEAD~2 &&
+	echo "line 1 from test branch" >>hello &&
+	echo "line 2 from test branch" >>hello &&
+	git add hello &&
+	test_tick &&
+	git commit -m "hello: 2 more lines from a test branch" &&
+	HASH9=$(git rev-parse --verify HEAD) &&
+	git tag -s -m "tag for testing with a mergetag" test_tag HEAD &&
+	git checkout master &&
+	git merge -s ours test_tag &&
+	HASH10=$(git rev-parse --verify HEAD) &&
+	git cat-file commit $HASH10 | grep "^mergetag object"
+'
+
+test_expect_success GPG '--graft on a commit with a mergetag' '
+	test_must_fail git replace --graft $HASH10 $HASH8^1 &&
+	git replace --graft $HASH10 $HASH8^1 $HASH9 &&
+	git replace -d $HASH10
+'
+
 test_done
-- 
2.0.0.421.g786a89d.dirty
Previous: Christian CouderNext: Junio C Hamano
Message 10 of 11 in “Add --graft option to git replace”
  1. 0/9 Add --graft option to git replaceChristian Couder, Jul 19, 2014
  2. 1/9 replace: cleanup redirection style in testsChristian Couder, Jul 19, 2014
  3. 2/9 replace: add --graft optionChristian Couder, Jul 19, 2014
  4. 3/9 replace: add test for --graftChristian Couder, Jul 19, 2014
  5. 4/9 Documentation: replace: add --graft optionChristian Couder, Jul 19, 2014
  6. 5/9 contrib: add convert-grafts-to-replace-refs.shChristian Couder, Jul 19, 2014
  7. 6/9 replace: remove signature when using --graftChristian Couder, Jul 19, 2014
  8. 7/9 replace: add test for --graft with signed commitChristian Couder, Jul 19, 2014
  9. 8/9 replace: check mergetags when using --graftChristian Couder, Jul 19, 2014
  10. 9/9 replace: add test for --graft with a mergetagChristian Couder, Jul 19, 2014
  11. Junio C HamanoJul 21, 2014

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.