You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NoteMerger.java 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (C) 2010, Sasa Zivkov <sasa.zivkov@sap.com> and others
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.notes;
  11. import java.io.IOException;
  12. import org.eclipse.jgit.lib.ObjectInserter;
  13. import org.eclipse.jgit.lib.ObjectReader;
  14. /**
  15. * Three-way note merge operation.
  16. * <p>
  17. * This operation takes three versions of a note: base, ours and theirs,
  18. * performs the three-way merge and returns the merge result.
  19. */
  20. public interface NoteMerger {
  21. /**
  22. * Merges the conflicting note changes.
  23. * <p>
  24. * base, ours and their are all notes on the same object.
  25. *
  26. * @param base
  27. * version of the Note
  28. * @param ours
  29. * version of the Note
  30. * @param their
  31. * version of the Note
  32. * @param reader
  33. * the object reader that must be used to read Git objects
  34. * @param inserter
  35. * the object inserter that must be used to insert Git objects
  36. * @return the merge result
  37. * @throws org.eclipse.jgit.notes.NotesMergeConflictException
  38. * in case there was a merge conflict which this note merger
  39. * couldn't resolve
  40. * @throws java.io.IOException
  41. * in case the reader or the inserter would throw an
  42. * java.io.IOException the implementor will most likely want to
  43. * propagate it as it can't do much to recover from it
  44. */
  45. Note merge(Note base, Note ours, Note their, ObjectReader reader,
  46. ObjectInserter inserter) throws NotesMergeConflictException,
  47. IOException;
  48. }