From 7bceae12ea1aacbe2e200297655f5ca717da0a2b Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Thu, 1 Feb 2007 17:08:19 -0500 Subject: [PATCH] Only compute the merge of subtrees if they differ. If two subtrees have the same Id then they have the exact same content. There is no reason to recurse into them and compute a merge, as every single entry within the subtree will come up as being equal. Signed-off-by: Shawn O. Pearce --- org.spearce.jgit/src/org/spearce/jgit/lib/MergedTree.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/MergedTree.java b/org.spearce.jgit/src/org/spearce/jgit/lib/MergedTree.java index f31b1910..a0c30b96 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/lib/MergedTree.java +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/MergedTree.java @@ -196,12 +196,12 @@ public class MergedTree { final TreeEntry e = newMerged[pos]; mergeCurrentTree = !(e instanceof Tree) || e.getId() == null - || e.getId().equals(thisEntry.getId()); + || !e.getId().equals(thisEntry.getId()); } else if (!mergeCurrentTree) { final TreeEntry e = newMerged[pos + srcId - 1]; mergeCurrentTree = !(e instanceof Tree) || e.getId() == null - || e.getId().equals(thisEntry.getId()); + || !e.getId().equals(thisEntry.getId()); } } if (++treeIndexes[srcId] == ents.length) -- 2.11.4.GIT