From f8e229d56956276d92f9e9edb73659a84517cf2b Mon Sep 17 00:00:00 2001 From: Dmitrii Filippov Date: Mon, 1 Aug 2022 18:43:43 +0200 Subject: [PATCH] Rename fastMinHasMatch to allTreesNamesMatchFastMinRef Change-Id: I2d9165616650e9d44745c6848d2cf1045f53f33c --- .../jgit/treewalk/NameConflictTreeWalk.java | 16 ++++++++-------- 1 file 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; } -- 2.39.5