]> source.dussan.org Git - jgit.git/commit
[merge] Fix merge conflicts with symlinks 19/195219/3
authorThomas Wolf <twolf@apache.org>
Mon, 15 Aug 2022 23:02:21 +0000 (01:02 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Wed, 7 Sep 2022 13:02:02 +0000 (15:02 +0200)
commita8e683fef6acf3e9f00ac2648fff60b13a28fb13
treea83746d664b648d784aa441e18b28a33f2a1879d
parent583bf00233d2c3f0fc6b1e90f940d31e2dec5ad0
[merge] Fix merge conflicts with symlinks

Previous code would do a content merge on symlinks, and write the merge
result to the working tree as a file. C git doesn't do this; it leaves
a symlink in the working tree unchanged, or in a delete-modify conflict
it would check out "theirs".

Moreover, previous code would write the merge result to the link target,
not to the link. This would overwrite an existing link target, or fail
if the link pointed to a directory.

In link/file conflicts or file/link conflicts, C git always puts the
file into the working tree.

Change conflict handling accordingly. Add tests for all the conflict
cases.

Bug: 580347
Change-Id: I3cffcb4bcf8e336a85186031fff23f0c4b6ee19d
Signed-off-by: Thomas Wolf <twolf@apache.org>
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SymlinkMergeTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java