java.lang.Object
org.eclipse.jgit.merge.MergeAlgorithm
Provides the merge algorithm which does a three-way merge on content provided
as RawText. By default
HistogramDiff is used as
diff algorithm.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new MergeAlgorithm which usesHistogramDiffas diff algorithmMergeAlgorithm(DiffAlgorithm diff) Creates a new MergeAlgorithm -
Method Summary
Modifier and TypeMethodDescriptionRetrieves theContentMergeStrategy.<S extends Sequence>
MergeResult<S>merge(SequenceComparator<S> cmp, S base, S ours, S theirs) Does the three way merge between a common base and two sequences.voidsetContentMergeStrategy(ContentMergeStrategy strategy) Sets theContentMergeStrategy.
-
Constructor Details
-
MergeAlgorithm
public MergeAlgorithm()Creates a new MergeAlgorithm which usesHistogramDiffas diff algorithm -
MergeAlgorithm
Creates a new MergeAlgorithm- Parameters:
diff- the diff algorithm used by this merge
-
-
Method Details
-
getContentMergeStrategy
Retrieves theContentMergeStrategy.- Returns:
- the
ContentMergeStrategyin effect - Since:
- 5.12
-
setContentMergeStrategy
Sets theContentMergeStrategy.- Parameters:
strategy-ContentMergeStrategyto set; ifnull, setContentMergeStrategy.CONFLICT- Since:
- 5.12
-
merge
public <S extends Sequence> MergeResult<S> merge(SequenceComparator<S> cmp, S base, S ours, S theirs) Does the three way merge between a common base and two sequences.- Type Parameters:
S- type of the sequences- Parameters:
cmp- comparison method for this execution.base- the common base sequenceours- the first sequence to be mergedtheirs- the second sequence to be merged- Returns:
- the resulting content
-