aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2017-11-02 12:59:11 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2017-11-02 12:59:11 -0400
commit031646963fc8d0b9d2a87dca3ea2d05151f55441 (patch)
tree81b711f0d0ae58b72ae382710b0eb51ebc312d19 /org.eclipse.jgit
parent678c99c057786e5d285a222f7dcb6250ccc5a433 (diff)
parentabf420302bb03b119c19ddf29ef0c968f77c318d (diff)
downloadjgit-031646963fc8d0b9d2a87dca3ea2d05151f55441.tar.gz
jgit-031646963fc8d0b9d2a87dca3ea2d05151f55441.zip
Merge "Reintroduce protected method which removal broke EMF Compare" into stable-4.9
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/.settings/.api_filters12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java56
2 files changed, 68 insertions, 0 deletions
diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters
index 034b20f901..20d08c3a00 100644
--- a/org.eclipse.jgit/.settings/.api_filters
+++ b/org.eclipse.jgit/.settings/.api_filters
@@ -35,6 +35,18 @@
<message_argument value="processEntry(CanonicalTreeParser, CanonicalTreeParser, CanonicalTreeParser, DirCacheBuildIterator, WorkingTreeIterator, boolean)"/>
</message_arguments>
</filter>
+ <filter id="1141899266">
+ <message_arguments>
+ <message_argument value="3.5"/>
+ <message_argument value="4.9"/>
+ <message_argument value="processEntry(CanonicalTreeParser, CanonicalTreeParser, CanonicalTreeParser, DirCacheBuildIterator, WorkingTreeIterator, boolean)"/>
+ </message_arguments>
+ </filter>
+ <filter id="1143996420">
+ <message_arguments>
+ <message_argument value="processEntry(CanonicalTreeParser, CanonicalTreeParser, CanonicalTreeParser, DirCacheBuildIterator, WorkingTreeIterator, boolean)"/>
+ </message_arguments>
+ </filter>
</resource>
<resource path="src/org/eclipse/jgit/transport/http/HttpConnection.java" type="org.eclipse.jgit.transport.http.HttpConnection">
<filter id="403767336">
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
index 92c2bb35a1..23fdc35bd0 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
@@ -480,6 +480,62 @@ public class ResolveMerger extends ThreeWayMerger {
* @param ignoreConflicts
* see
* {@link ResolveMerger#mergeTrees(AbstractTreeIterator, RevTree, RevTree, boolean)}
+ * @return <code>false</code> if the merge will fail because the index entry
+ * didn't match ours or the working-dir file was dirty and a
+ * conflict occurred
+ * @throws MissingObjectException
+ * @throws IncorrectObjectTypeException
+ * @throws CorruptObjectException
+ * @throws IOException
+ * @since 3.5
+ * @deprecated
+ */
+ @Deprecated
+ protected boolean processEntry(CanonicalTreeParser base,
+ CanonicalTreeParser ours, CanonicalTreeParser theirs,
+ DirCacheBuildIterator index, WorkingTreeIterator work,
+ boolean ignoreConflicts) throws MissingObjectException,
+ IncorrectObjectTypeException, CorruptObjectException, IOException {
+ return processEntry(base, ours, theirs, index, work, ignoreConflicts,
+ null);
+ }
+
+ /**
+ * Processes one path and tries to merge taking git attributes in account.
+ * This method will do all trivial (not content) merges and will also detect
+ * if a merge will fail. The merge will fail when one of the following is
+ * true
+ * <ul>
+ * <li>the index entry does not match the entry in ours. When merging one
+ * branch into the current HEAD, ours will point to HEAD and theirs will
+ * point to the other branch. It is assumed that the index matches the HEAD
+ * because it will only not match HEAD if it was populated before the merge
+ * operation. But the merge commit should not accidentally contain
+ * modifications done before the merge. Check the <a href=
+ * "http://www.kernel.org/pub/software/scm/git/docs/git-read-tree.html#_3_way_merge"
+ * >git read-tree</a> documentation for further explanations.</li>
+ * <li>A conflict was detected and the working-tree file is dirty. When a
+ * conflict is detected the content-merge algorithm will try to write a
+ * merged version into the working-tree. If the file is dirty we would
+ * override unsaved data.</li>
+ * </ul>
+ *
+ * @param base
+ * the common base for ours and theirs
+ * @param ours
+ * the ours side of the merge. When merging a branch into the
+ * HEAD ours will point to HEAD
+ * @param theirs
+ * the theirs side of the merge. When merging a branch into the
+ * current HEAD theirs will point to the branch which is merged
+ * into HEAD.
+ * @param index
+ * the index entry
+ * @param work
+ * the file in the working tree
+ * @param ignoreConflicts
+ * see
+ * {@link ResolveMerger#mergeTrees(AbstractTreeIterator, RevTree, RevTree, boolean)}
* @param attributes
* the attributes defined for this entry
* @return <code>false</code> if the merge will fail because the index entry