[PATCH] Add test that checks octopus merge cleanup

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Thomas Rast
Date: Monday, September 15, 2008 - 3:49 pm

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)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[IRC/patches] Failed octopus merge does not clean up, Thomas Rast, (Mon Sep 15, 3:48 pm)
[PATCH] Add test that checks octopus merge cleanup, Thomas Rast, (Mon Sep 15, 3:49 pm)
Re: [IRC/patches] Failed octopus merge does not clean up, Junio C Hamano, (Mon Sep 15, 4:36 pm)
Re: [IRC/patches] Failed octopus merge does not clean up, Junio C Hamano, (Mon Sep 15, 5:20 pm)
Re: [IRC/patches] Failed octopus merge does not clean up, Jakub Narebski, (Tue Sep 16, 3:53 pm)
Re: [IRC/patches] Failed octopus merge does not clean up, Andreas Ericsson, (Tue Sep 16, 11:45 pm)
Re: [IRC/patches] Failed octopus merge does not clean up, Jakub Narebski, (Wed Sep 17, 1:11 am)
Re: [IRC/patches] Failed octopus merge does not clean up, Andreas Ericsson, (Wed Sep 17, 9:40 am)