Example usage for org.eclipse.jgit.merge MergeResult add

List of usage examples for org.eclipse.jgit.merge MergeResult add

Introduction

In this page you can find the example usage for org.eclipse.jgit.merge MergeResult add.

Prototype

public void add(int srcIdx, int begin, int end, ConflictState conflictState) 

Source Link

Document

Adds a new range from one of the merged sequences or from the common predecessor.

Usage

From source file:com.itemis.maven.plugins.unleash.scm.providers.merge.UnleashGitMerger.java

License:Eclipse Distribution License

private MergeResult<RawText> contentMerge(CanonicalTreeParser base, CanonicalTreeParser ours,
        CanonicalTreeParser theirs) throws IOException {
    InputStream localIn = getInputStream(ours.getEntryObjectId());
    InputStream remoteIn = getInputStream(theirs.getEntryObjectId());
    InputStream baseIn = getInputStream(base.getEntryObjectId());
    ByteArrayOutputStream resultOut = new ByteArrayOutputStream();

    this.mergeClient.merge(localIn, remoteIn, baseIn, resultOut);
    RawText resultText = new RawText(resultOut.toByteArray());

    List<RawText> sequences = new ArrayList<RawText>(1);
    sequences.add(resultText);/*from ww  w.  j a va2s . c  o  m*/
    MergeResult<RawText> result = new MergeResult<RawText>(sequences);
    result.add(0, 0, resultText.size(), ConflictState.NO_CONFLICT);

    return result;
}