summaryrefslogtreecommitdiff
path: root/t/t3030-merge-recursive.sh
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2010-06-08 13:34:12 +0200
committerJunio C Hamano <gitster@pobox.com>2010-06-11 09:01:07 -0700
commit7d82b06d2be1b872a1debf79fadf0585afc70b69 (patch)
tree9543032d343225699ef5056712d65c27d985c91b /t/t3030-merge-recursive.sh
parent19b9b0b220be08025d4db9a1c85e21637bf8fd95 (diff)
downloadgit-7d82b06d2be1b872a1debf79fadf0585afc70b69.tar.gz
merge-recursive: demonstrate an incorrect conflict with submodule
When one side of a merge turns a directory into a submodule, and the other side does not touch that directory (but has other non-conflicting changes), then a merge should succeed. But currently, it does not; it rather fails with a file/directory conflict. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3030-merge-recursive.sh')
-rwxr-xr-xt/t3030-merge-recursive.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index 9929f82021..d541544537 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -22,6 +22,7 @@ test_expect_success 'setup 1' '
git branch df-2 &&
git branch df-3 &&
git branch remove &&
+ git branch submod &&
echo hello >>a &&
cp a d/e &&
@@ -236,6 +237,17 @@ test_expect_success 'setup 6' '
test_cmp expected actual
'
+test_expect_success 'setup 7' '
+
+ git checkout submod &&
+ git rm d/e &&
+ test_tick &&
+ git commit -m "remove d/e" &&
+ git update-index --add --cacheinfo 160000 $c1 d &&
+ test_tick &&
+ git commit -m "make d/ a submodule"
+'
+
test_expect_success 'merge-recursive simple' '
rm -fr [abcd] &&
@@ -551,4 +563,21 @@ test_expect_success 'merge removes empty directories' '
test_must_fail test -d d
'
+test_expect_failure 'merge-recursive simple w/submodule' '
+
+ git checkout submod &&
+ git merge remove
+'
+
+test_expect_failure 'merge-recursive simple w/submodule result' '
+
+ git ls-files -s >actual &&
+ (
+ echo "100644 $o5 0 a"
+ echo "100644 $o0 0 c"
+ echo "160000 $c1 0 d"
+ ) >expected &&
+ test_cmp expected actual
+'
+
test_done