Class DefaultNoteMerger

  extended by org.eclipse.jgit.notes.DefaultNoteMerger
All Implemented Interfaces:

public class DefaultNoteMerger
extends Object
implements NoteMerger

Default implementation of the NoteMerger.

If ours and theirs are both non-null, which means they are either both edits or both adds, then this merger will simply join the content of ours and theirs (in that order) and return that as the merge result.

If one or ours/theirs is non-null and the other one is null then the non-null value is returned as the merge result. This means that an edit/delete conflict is resolved by keeping the edit version.

If both ours and theirs are null then the result of the merge is also null.

Constructor Summary
Method Summary
 Note merge(Note base, Note ours, Note theirs, ObjectReader reader, ObjectInserter inserter)
          Merges the conflicting note changes.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public DefaultNoteMerger()
Method Detail


public Note merge(Note base,
                  Note ours,
                  Note theirs,
                  ObjectReader reader,
                  ObjectInserter inserter)
           throws IOException
Description copied from interface: NoteMerger
Merges the conflicting note changes.

base, ours and their are all notes on the same object.

Specified by:
merge in interface NoteMerger
base - version of the Note
ours - version of the Note
theirs - version of the Note
reader - the object reader that must be used to read Git objects
inserter - the object inserter that must be used to insert Git objects
the merge result
NotesMergeConflictException - in case there was a merge conflict which this note merger couldn't resolve
IOException - in case the reader or the inserter would throw an IOException the implementor will most likely want to propagate it as it can't do much to recover from it

Copyright © 2013. All Rights Reserved.