[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)