aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMerger.java
blob: 78ec8b31daf3731a81d3261a9cfa1057af044d8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * Copyright (C) 2010, Sasa Zivkov <sasa.zivkov@sap.com> and others
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

package org.eclipse.jgit.notes;

import java.io.IOException;

import org.eclipse.jgit.lib.ObjectInserter;
import org.eclipse.jgit.lib.ObjectReader;

/**
 * Three-way note merge operation.
 * <p>
 * This operation takes three versions of a note: base, ours and theirs,
 * performs the three-way merge and returns the merge result.
 */
public interface NoteMerger {

	/**
	 * Merges the conflicting note changes.
	 * <p>
	 * base, ours and their are all notes on the same object.
	 *
	 * @param base
	 *            version of the Note
	 * @param ours
	 *            version of the Note
	 * @param their
	 *            version of the Note
	 * @param reader
	 *            the object reader that must be used to read Git objects
	 * @param inserter
	 *            the object inserter that must be used to insert Git objects
	 * @return the merge result
	 * @throws org.eclipse.jgit.notes.NotesMergeConflictException
	 *             in case there was a merge conflict which this note merger
	 *             couldn't resolve
	 * @throws java.io.IOException
	 *             in case the reader or the inserter would throw an
	 *             java.io.IOException the implementor will most likely want to
	 *             propagate it as it can't do much to recover from it
	 */
	Note merge(Note base, Note ours, Note their, ObjectReader reader,
			ObjectInserter inserter) throws NotesMergeConflictException,
			IOException;
}