aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-12-22 23:10:20 +0100
committerJunio C Hamano <gitster@pobox.com>2008-12-24 23:06:48 -0800
commit36e3b5eafe967cb721f5e2bbaa396f979b8ebd7c (patch)
tree91adeb02422aeb2b69418c9d3ca23ed9e14a7dfa /t
parent8104ebfe8276657ee803cca7eb8665a78cf3ef83 (diff)
downloadgit-36e3b5eafe967cb721f5e2bbaa396f979b8ebd7c.tar.gz
git-36e3b5eafe967cb721f5e2bbaa396f979b8ebd7c.tar.xz
merge-recursive: mark rename/delete conflict as unmerged
When a file was renamed in one branch, but deleted in the other, one should expect the index to contain an unmerged entry, namely the target of the rename. Make it so. Noticed by Constantine Plotnikov. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t6024-recursive-merge.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t6024-recursive-merge.sh b/t/t6024-recursive-merge.sh
index 802d0d06e..129fa3000 100755
--- a/t/t6024-recursive-merge.sh
+++ b/t/t6024-recursive-merge.sh
@@ -97,4 +97,27 @@ test_expect_success 'refuse to merge binary files' '
merge.err
'
+test_expect_success 'mark rename/delete as unmerged' '
+
+ git reset --hard &&
+ git checkout -b delete &&
+ git rm a1 &&
+ test_tick &&
+ git commit -m delete &&
+ git checkout -b rename HEAD^ &&
+ git mv a1 a2
+ test_tick &&
+ git commit -m rename &&
+ test_must_fail git merge delete &&
+ test 1 = $(git ls-files --unmerged | wc -l) &&
+ git rev-parse --verify :2:a2 &&
+ test_must_fail git rev-parse --verify :3:a2 &&
+ git checkout -f delete &&
+ test_must_fail git merge rename &&
+ test 1 = $(git ls-files --unmerged | wc -l) &&
+ test_must_fail git rev-parse --verify :2:a2 &&
+ git rev-parse --verify :3:a2
+
+'
+
test_done