diff options
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java index 3c8553c74f..8085dfaa24 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/NameConflictTreeWalk.java @@ -56,7 +56,7 @@ import org.eclipse.jgit.lib.Repository; public class NameConflictTreeWalk extends TreeWalk { private static final int TREE_MODE = FileMode.TREE.getBits(); - private boolean fastMinHasMatch; + private boolean allTreesNamesMatchFastMinRef; private AbstractTreeIterator dfConflict; @@ -97,7 +97,7 @@ public class NameConflictTreeWalk extends TreeWalk { AbstractTreeIterator min() throws CorruptObjectException { for (;;) { final AbstractTreeIterator minRef = fastMin(); - if (fastMinHasMatch) + if (allTreesNamesMatchFastMinRef) return minRef; if (isTree(minRef)) { @@ -118,7 +118,7 @@ public class NameConflictTreeWalk extends TreeWalk { } private AbstractTreeIterator fastMin() { - fastMinHasMatch = true; + allTreesNamesMatchFastMinRef = true; int i = 0; AbstractTreeIterator minRef = trees[i]; @@ -136,7 +136,7 @@ public class NameConflictTreeWalk extends TreeWalk { final int cmp = t.pathCompare(minRef); if (cmp < 0) { - if (fastMinHasMatch && isTree(minRef) && !isTree(t) + if (allTreesNamesMatchFastMinRef && isTree(minRef) && !isTree(t) && nameEqual(minRef, t)) { // We used to be at a tree, but now we are at a file // with the same name. Allow the file to match the @@ -145,7 +145,7 @@ public class NameConflictTreeWalk extends TreeWalk { t.matches = minRef; hasConflict = true; } else { - fastMinHasMatch = false; + allTreesNamesMatchFastMinRef = false; t.matches = t; minRef = t; } @@ -153,7 +153,7 @@ public class NameConflictTreeWalk extends TreeWalk { // Exact name/mode match is best. // t.matches = minRef; - } else if (fastMinHasMatch && isTree(t) && !isTree(minRef) + } else if (allTreesNamesMatchFastMinRef && isTree(t) && !isTree(minRef) && !isGitlink(minRef) && nameEqual(t, minRef)) { // The minimum is a file (non-tree) but the next entry // of this iterator is a tree whose name matches our file. @@ -172,10 +172,10 @@ public class NameConflictTreeWalk extends TreeWalk { minRef = t; hasConflict = true; } else - fastMinHasMatch = false; + allTreesNamesMatchFastMinRef = false; } - if (hasConflict && fastMinHasMatch && dfConflict == null) + if (hasConflict && allTreesNamesMatchFastMinRef && dfConflict == null) dfConflict = minRef; return minRef; } |