Rename fastMinHasMatch to allTreesNamesMatchFastMinRef

Change-Id: I2d9165616650e9d44745c6848d2cf1045f53f33c
This commit is contained in:
Dmitrii Filippov 2022-08-01 18:43:43 +02:00
parent e030b106c5
commit f8e229d569
1 changed files with 8 additions and 8 deletions

View File

@ -56,7 +56,7 @@
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 NameConflictTreeWalk(ObjectReader or) {
AbstractTreeIterator min() throws CorruptObjectException {
for (;;) {
final AbstractTreeIterator minRef = fastMin();
if (fastMinHasMatch)
if (allTreesNamesMatchFastMinRef)
return minRef;
if (isTree(minRef)) {
@ -118,7 +118,7 @@ AbstractTreeIterator min() throws CorruptObjectException {
}
private AbstractTreeIterator fastMin() {
fastMinHasMatch = true;
allTreesNamesMatchFastMinRef = true;
int i = 0;
AbstractTreeIterator minRef = trees[i];
@ -136,7 +136,7 @@ private AbstractTreeIterator fastMin() {
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 @@ && nameEqual(minRef, t)) {
t.matches = minRef;
hasConflict = true;
} else {
fastMinHasMatch = false;
allTreesNamesMatchFastMinRef = false;
t.matches = t;
minRef = t;
}
@ -153,7 +153,7 @@ && nameEqual(minRef, t)) {
// 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 @@ && nameEqual(minRef, t)) {
minRef = t;
hasConflict = true;
} else
fastMinHasMatch = false;
allTreesNamesMatchFastMinRef = false;
}
if (hasConflict && fastMinHasMatch && dfConflict == null)
if (hasConflict && allTreesNamesMatchFastMinRef && dfConflict == null)
dfConflict = minRef;
return minRef;
}