]> source.dussan.org Git - jgit.git/commit
Fix RecursiveMerger in case of multiple, independent base commits 67/44567/1
authorChristian Halstrick <christian.halstrick@sap.com>
Wed, 25 Mar 2015 09:48:03 +0000 (10:48 +0100)
committerChristian Halstrick <christian.halstrick@sap.com>
Wed, 25 Mar 2015 09:49:58 +0000 (10:49 +0100)
commit2bd3556e7e1f07c4bb06282ead95a936758e388e
treee989b058ea85e7df88cc5c80b460fe5d9247d672
parentf1a15f7eb09183124ea645a8bfc16a03d58fd385
Fix RecursiveMerger in case of multiple, independent base commits

When RecursiveMerger found that there are multiple base-commits for the
commits to be merged it tries to temporarily merge the base commits. But
if these base commits have no common predecessor there was a bug in JGit
leading to a NPE. This commit fixes this by enforcing that an empty tree
is used as base when merging two unrelated base commits.

This logic was already there when merging two commits which have no
common predecessor (ThreeWayMerger.mergeBase()). But the code which was
computing a new temporary base commit in case of criss-cross merges
didn't take care to pick an empty tree when no common predecessor can be
found.

Bug: 462671
Change-Id: Ibd96302f5f81383f36d3b1e3edcbf5822147b1a4
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/RecursiveMergerTest.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java