Rename fastMinHasMatch to allTreesNamesMatchFastMinRef
Change-Id: I2d9165616650e9d44745c6848d2cf1045f53f33c
This commit is contained in:
parent
e030b106c5
commit
f8e229d569
|
@ -56,7 +56,7 @@
|
||||||
public class NameConflictTreeWalk extends TreeWalk {
|
public class NameConflictTreeWalk extends TreeWalk {
|
||||||
private static final int TREE_MODE = FileMode.TREE.getBits();
|
private static final int TREE_MODE = FileMode.TREE.getBits();
|
||||||
|
|
||||||
private boolean fastMinHasMatch;
|
private boolean allTreesNamesMatchFastMinRef;
|
||||||
|
|
||||||
private AbstractTreeIterator dfConflict;
|
private AbstractTreeIterator dfConflict;
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ public NameConflictTreeWalk(ObjectReader or) {
|
||||||
AbstractTreeIterator min() throws CorruptObjectException {
|
AbstractTreeIterator min() throws CorruptObjectException {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
final AbstractTreeIterator minRef = fastMin();
|
final AbstractTreeIterator minRef = fastMin();
|
||||||
if (fastMinHasMatch)
|
if (allTreesNamesMatchFastMinRef)
|
||||||
return minRef;
|
return minRef;
|
||||||
|
|
||||||
if (isTree(minRef)) {
|
if (isTree(minRef)) {
|
||||||
|
@ -118,7 +118,7 @@ AbstractTreeIterator min() throws CorruptObjectException {
|
||||||
}
|
}
|
||||||
|
|
||||||
private AbstractTreeIterator fastMin() {
|
private AbstractTreeIterator fastMin() {
|
||||||
fastMinHasMatch = true;
|
allTreesNamesMatchFastMinRef = true;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
AbstractTreeIterator minRef = trees[i];
|
AbstractTreeIterator minRef = trees[i];
|
||||||
|
@ -136,7 +136,7 @@ private AbstractTreeIterator fastMin() {
|
||||||
|
|
||||||
final int cmp = t.pathCompare(minRef);
|
final int cmp = t.pathCompare(minRef);
|
||||||
if (cmp < 0) {
|
if (cmp < 0) {
|
||||||
if (fastMinHasMatch && isTree(minRef) && !isTree(t)
|
if (allTreesNamesMatchFastMinRef && isTree(minRef) && !isTree(t)
|
||||||
&& nameEqual(minRef, t)) {
|
&& nameEqual(minRef, t)) {
|
||||||
// We used to be at a tree, but now we are at a file
|
// We used to be at a tree, but now we are at a file
|
||||||
// with the same name. Allow the file to match the
|
// with the same name. Allow the file to match the
|
||||||
|
@ -145,7 +145,7 @@ && nameEqual(minRef, t)) {
|
||||||
t.matches = minRef;
|
t.matches = minRef;
|
||||||
hasConflict = true;
|
hasConflict = true;
|
||||||
} else {
|
} else {
|
||||||
fastMinHasMatch = false;
|
allTreesNamesMatchFastMinRef = false;
|
||||||
t.matches = t;
|
t.matches = t;
|
||||||
minRef = t;
|
minRef = t;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ && nameEqual(minRef, t)) {
|
||||||
// Exact name/mode match is best.
|
// Exact name/mode match is best.
|
||||||
//
|
//
|
||||||
t.matches = minRef;
|
t.matches = minRef;
|
||||||
} else if (fastMinHasMatch && isTree(t) && !isTree(minRef)
|
} else if (allTreesNamesMatchFastMinRef && isTree(t) && !isTree(minRef)
|
||||||
&& !isGitlink(minRef) && nameEqual(t, minRef)) {
|
&& !isGitlink(minRef) && nameEqual(t, minRef)) {
|
||||||
// The minimum is a file (non-tree) but the next entry
|
// The minimum is a file (non-tree) but the next entry
|
||||||
// of this iterator is a tree whose name matches our file.
|
// of this iterator is a tree whose name matches our file.
|
||||||
|
@ -172,10 +172,10 @@ && nameEqual(minRef, t)) {
|
||||||
minRef = t;
|
minRef = t;
|
||||||
hasConflict = true;
|
hasConflict = true;
|
||||||
} else
|
} else
|
||||||
fastMinHasMatch = false;
|
allTreesNamesMatchFastMinRef = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasConflict && fastMinHasMatch && dfConflict == null)
|
if (hasConflict && allTreesNamesMatchFastMinRef && dfConflict == null)
|
||||||
dfConflict = minRef;
|
dfConflict = minRef;
|
||||||
return minRef;
|
return minRef;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue