@matheusbsbs / matheus-bagliano / commits / 7d82b06d2b
Fork 0

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>

Johannes Sixt committed Jun 8, 2010 at 13:34 UTC 7d82b06d2be1b872a1debf79fadf0585afc70b69
1 file changed +29
t/t3030-merge-recursive.sh
+29
@@ -22,6 +22,7 @@ test_expect_success 'setup 1' '
22 git branch df-2 &&
23 git branch df-3 &&
24 git branch remove &&
25 + git branch submod &&
26
27 echo hello >>a &&
28 cp a d/e &&
@@ -236,6 +237,17 @@ test_expect_success 'setup 6' '
237 test_cmp expected actual
238 '
239
240 +test_expect_success 'setup 7' '
241 +
242 + git checkout submod &&
243 + git rm d/e &&
244 + test_tick &&
245 + git commit -m "remove d/e" &&
246 + git update-index --add --cacheinfo 160000 $c1 d &&
247 + test_tick &&
248 + git commit -m "make d/ a submodule"
249 +'
250 +
251 test_expect_success 'merge-recursive simple' '
252
253 rm -fr [abcd] &&
@@ -551,4 +563,21 @@ test_expect_success 'merge removes empty directories' '
563 test_must_fail test -d d
564 '
565
566 +test_expect_failure 'merge-recursive simple w/submodule' '
567 +
568 + git checkout submod &&
569 + git merge remove
570 +'
571 +
572 +test_expect_failure 'merge-recursive simple w/submodule result' '
573 +
574 + git ls-files -s >actual &&
575 + (
576 + echo "100644 $o5 0 a"
577 + echo "100644 $o0 0 c"
578 + echo "160000 $c1 0 d"
579 + ) >expected &&
580 + test_cmp expected actual
581 +'
582 +
583 test_done