diff options
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java index 16859646b6..992928bc43 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java @@ -683,8 +683,6 @@ public class TreeWalk { final AbstractTreeIterator ch = currentHead; final AbstractTreeIterator a = trees[nthA]; final AbstractTreeIterator b = trees[nthB]; - if (a.matches == ch && b.matches == ch) - return a.idEqual(b); if (a.matches != ch && b.matches != ch) { // If neither tree matches the current path node then neither // tree has this entry. In such case the ObjectId is zero(), @@ -692,6 +690,10 @@ public class TreeWalk { // return true; } + if (!a.hasId() || !b.hasId()) + return false; + if (a.matches == ch && b.matches == ch) + return a.idEqual(b); return false; } |