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

[PATCH] Add test that checks octopus merge cleanup

From
Thomas Rast <trast@student.ethz.ch>
Date
Sep 15, 2008, 22:49 UTC
Message-ID
<1221518994-26111-1-git-send-email-trast@student.ethz.ch>
In-Reply-To
<200809160048.31443.trast@student.ethz.ch>

Currently, a conflicted octopus merge leaves the repository in a "halfway into the merge state", where .git/MERGE_HEAD is missing but the files are listed as conflicted in the index and have conflict markers in them. It should either clean up everything, or add a MERGE_HEAD.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 t/t7607-merge-octopus-cleanup.sh |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/t/t7607-merge-octopus-cleanup.sh b/t/t7607-merge-octopus-cleanup.sh
new file mode 100755
index 0000000..4d82867
--- /dev/null
+++ b/t/t7607-merge-octopus-cleanup.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+test_description='git merge
+
+Testing that conflicting octopus merge fails cleanly.'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+	echo initial > foo &&
+	git add foo &&
+	git commit -m initial &&
+	echo a > foo &&
+	git commit -m a foo &&
+	git checkout -b b HEAD^ &&
+	echo b > foo &&
+	git commit -m b foo &&
+	git checkout -b c HEAD^ &&
+	echo c > foo &&
+	git commit -m c foo &&
+	git checkout master
+'
+
+test_expect_failure 'conflicted octopus merge' '
+	test_must_fail git merge b c &&
+	test -z "$(git ls-files --unmerged)" &&
+	test "$(cat foo)" == a &&
+	test ! -f .git/MERGE_HEAD
+'
+
+test_done
-- 
tg: (1293c95..) t/test-octopus-cleanup (depends on: origin/master)
Previous: Thomas RastNext: Thomas Rast
Message 2 of 17 in “[IRC/patches] Failed octopus merge does not clean up”
  1. Thomas RastSep 15, 2008
  2. Add test that checks octopus merge cleanupThomas Rast, Sep 15, 2008
  3. Documentation: warn against merging in a dirty treeThomas Rast, Sep 15, 2008
  4. Junio C HamanoSep 15, 2008
  5. Avery PennarunSep 15, 2008
  6. Junio C HamanoSep 16, 2008
  7. Linus TorvaldsSep 18, 2008
  8. Avery PennarunSep 18, 2008
  9. Junio C HamanoSep 19, 2008
  10. Junio C HamanoSep 15, 2008
  11. Thomas RastSep 15, 2008
  12. Junio C HamanoSep 16, 2008
  13. Jakub NarebskiSep 16, 2008
  14. Andreas EricssonSep 17, 2008
  15. Jakub NarebskiSep 17, 2008
  16. Miklos VajnaSep 17, 2008
  17. Andreas EricssonSep 17, 2008

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.