Package org.eclipse.jgit.merge
Class StrategySimpleTwoWayInCore
- java.lang.Object
-
- org.eclipse.jgit.merge.MergeStrategy
-
- org.eclipse.jgit.merge.ThreeWayMergeStrategy
-
- org.eclipse.jgit.merge.StrategySimpleTwoWayInCore
-
public class StrategySimpleTwoWayInCore extends ThreeWayMergeStrategy
Merges two commits together in-memory, ignoring any working directory.The strategy chooses a path from one of the two input trees if the path is unchanged in the other relative to their common merge base tree. This is a trivial 3-way merge (at the file path level only).
Modifications of the same file path (content and/or file mode) by both input trees will cause a merge conflict, as this strategy does not attempt to merge file contents.
-
-
Field Summary
-
Fields inherited from class org.eclipse.jgit.merge.MergeStrategy
OURS, RECURSIVE, RESOLVE, SIMPLE_TWO_WAY_IN_CORE, THEIRS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedStrategySimpleTwoWayInCore()Create a new instance of the strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Get default name of this strategy implementation.ThreeWayMergernewMerger(ObjectInserter inserter, Config config)Create a new merge instance.ThreeWayMergernewMerger(Repository db)Create a new merge instance.ThreeWayMergernewMerger(Repository db, boolean inCore)Create a new merge instance.-
Methods inherited from class org.eclipse.jgit.merge.MergeStrategy
get, get, register, register
-
-
-
-
Method Detail
-
getName
public String getName()
Get default name of this strategy implementation.- Specified by:
getNamein classMergeStrategy- Returns:
- default name of this strategy implementation.
-
newMerger
public ThreeWayMerger newMerger(Repository db)
Create a new merge instance.- Specified by:
newMergerin classThreeWayMergeStrategy- Parameters:
db- repository database the merger will read from, and eventually write results back to.- Returns:
- the new merge instance which implements this strategy.
-
newMerger
public ThreeWayMerger newMerger(Repository db, boolean inCore)
Create a new merge instance.- Specified by:
newMergerin classThreeWayMergeStrategy- Parameters:
db- repository database the merger will read from, and eventually write results back to.inCore- the merge will happen in memory, working folder will not be modified, in case of a non-trivial merge that requires manual resolution, the merger will fail.- Returns:
- the new merge instance which implements this strategy.
-
newMerger
public ThreeWayMerger newMerger(ObjectInserter inserter, Config config)
Create a new merge instance.The merge will happen in memory, working folder will not be modified, in case of a non-trivial merge that requires manual resolution, the merger will fail.
- Specified by:
newMergerin classMergeStrategy- Parameters:
inserter- inserter to write results back to.config- repo config for reading diff algorithm settings.- Returns:
- the new merge instance which implements this strategy.
-
-