Skip to content

Commit 1c9b2d3

Browse files
raalkmlgitster
authored andcommitted
Add a reminder test case for a merge with F/D transition
The problem is that if a file was replaced with a directory containing another file with the same content and mode, an attempt to merge it with a branch descended from a commit before this F->D transition will cause merge-recursive to break. It breaks even if there were no conflicting changes on that other branch. Originally reported by Anders Melchiorsen. Signed-off-by: Alex Riesen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6641575 commit 1c9b2d3

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

t/t6020-merge-df.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,27 @@ git commit -m "File: dir"'
2222

2323
test_expect_code 1 'Merge with d/f conflicts' 'git merge "merge msg" B master'
2424

25+
test_expect_failure 'F/D conflict' '
26+
git reset --hard &&
27+
git checkout master &&
28+
rm .git/index &&
29+
30+
mkdir before &&
31+
echo FILE >before/one &&
32+
echo FILE >after &&
33+
git add . &&
34+
git commit -m first &&
35+
36+
rm -f after &&
37+
git mv before after &&
38+
git commit -m move &&
39+
40+
git checkout -b para HEAD^ &&
41+
echo COMPLETELY ANOTHER FILE >another &&
42+
git add . &&
43+
git commit -m para &&
44+
45+
git merge master
46+
'
47+
2548
test_done

0 commit comments

Comments
 (0)