]> source.dussan.org Git - jgit.git/commit
ResolveMerger: Ignore merge conflicts if asked so 92/159692/2
authorIvan Frade <ifrade@google.com>
Wed, 18 Mar 2020 05:29:59 +0000 (22:29 -0700)
committerIvan Frade <ifrade@google.com>
Thu, 19 Mar 2020 23:36:21 +0000 (16:36 -0700)
commit7d3b6308fc2e44e8ae462d56fb2f1aa61012fb35
tree74dd9be46c4f6be7c65ac56a530f79999b4f8b2a
parent6e0a923e90ac6d5a91cafadd85637fda3da9b432
ResolveMerger: Ignore merge conflicts if asked so

The recursive merge strategy builds a virtual ancestor merging
recursively the common bases (when more than one) between the
want-to-merge commits. While building this virtual ancestor, content
conflicts are ignored, but current code doesn't do so when a file is
removed.

This was spotted in [1], for example. Merging two commits to build the
virtual ancestor bumped into a conflict (modified in one side, deleted
in the other) that stopped the process.

Follow the "spec" and in case of conflict leave the unmerged content in
the index and working trees.

[1] https://android-review.googlesource.com/c/kernel/common/+/1228962

Change-Id: Ife9c32ae3ac3a87d3660fa1242e07854b65169d5
Signed-off-by: Ivan Frade <ifrade@google.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergerTest.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java