public abstract class ThreeWayMerger extends Merger
db, monitor, reader, sourceCommits, sourceObjects, sourceTrees, walk
Modifier | Constructor and Description |
---|---|
protected |
ThreeWayMerger(ObjectInserter inserter)
Create a new in-core merge instance from an inserter.
|
protected |
ThreeWayMerger(Repository local)
Create a new merge instance for a repository.
|
protected |
ThreeWayMerger(Repository local,
boolean inCore)
Create a new merge instance for a repository.
|
Modifier and Type | Method and Description |
---|---|
ObjectId |
getBaseCommitId()
Get the ID of the commit that was used as merge base for merging
|
boolean |
merge(AnyObjectId... tips)
Merge together two or more tree-ish objects.
|
protected AbstractTreeIterator |
mergeBase()
Create an iterator to walk the merge base.
|
void |
setBase(AnyObjectId id)
Set the common ancestor tree.
|
getBaseCommit, getObjectInserter, getRepository, getResultTreeId, merge, mergeImpl, nonNullRepo, openTree, setObjectInserter, setProgressMonitor
protected ThreeWayMerger(Repository local)
local
- the repository this merger will read and write data on.protected ThreeWayMerger(Repository local, boolean inCore)
local
- the repository this merger will read and write data on.inCore
- perform the merge in core with no working folder involvedprotected ThreeWayMerger(ObjectInserter inserter)
inserter
- the inserter to write objects to.public void setBase(AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException
id
- common base treeish; null to automatically compute the common
base from the input commits during
merge(AnyObjectId...)
.IncorrectObjectTypeException
- the object is not a treeish.MissingObjectException
- the object does not exist.IOException
- the object could not be read.public boolean merge(AnyObjectId... tips) throws IOException
Any tree-ish may be supplied as inputs. Commits and/or tags pointing at trees or commits may be passed as input objects.
merge
in class Merger
tips
- source trees to be combined together. The merge base is not
included in this set.IncorrectObjectTypeException
- one of the input objects is not a commit, but the strategy
requires it to be a commit.IOException
- one or more sources could not be read, or outputs could not
be written to the Repository.public ObjectId getBaseCommitId()
getBaseCommitId
in class Merger
protected AbstractTreeIterator mergeBase() throws IOException
IOException
Copyright © 2017 Eclipse JGit Project. All rights reserved.