Skip to content

Commit 7d82b06

Browse files
j6tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 19b9b0b commit 7d82b06

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

t/t3030-merge-recursive.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ test_expect_success 'setup 1' '
2222
git branch df-2 &&
2323
git branch df-3 &&
2424
git branch remove &&
25+
git branch submod &&
2526
2627
echo hello >>a &&
2728
cp a d/e &&
@@ -236,6 +237,17 @@ test_expect_success 'setup 6' '
236237
test_cmp expected actual
237238
'
238239

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+
239251
test_expect_success 'merge-recursive simple' '
240252
241253
rm -fr [abcd] &&
@@ -551,4 +563,21 @@ test_expect_success 'merge removes empty directories' '
551563
test_must_fail test -d d
552564
'
553565

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+
554583
test_done

0 commit comments

Comments
 (0)