Revert "RefDirectory.scanRef: Re-use file existence check done in snapshot creation"
This reverts commit f829f5f838
.
Using MISSING_FILEKEY as indicator for a non-existing file doesn't work
on Windows.
Bug: 577954
Change-Id: I92102a3d259f6cc0f367096a3213cfa794466817
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
This commit is contained in:
parent
f1547eec05
commit
7828ef349c
|
@ -439,15 +439,6 @@ public boolean equals(Object obj) {
|
||||||
return equals(other);
|
return equals(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if the file exists
|
|
||||||
*
|
|
||||||
* @return true if the file exists
|
|
||||||
*/
|
|
||||||
public boolean fileExists() {
|
|
||||||
return !MISSING_FILEKEY.equals(this.fileKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
|
|
|
@ -1103,10 +1103,6 @@ LooseRef scanRef(LooseRef ref, String name) throws IOException {
|
||||||
final int limit = 4096;
|
final int limit = 4096;
|
||||||
final byte[] buf;
|
final byte[] buf;
|
||||||
FileSnapshot otherSnapshot = FileSnapshot.save(path);
|
FileSnapshot otherSnapshot = FileSnapshot.save(path);
|
||||||
if (!otherSnapshot.fileExists()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
buf = IO.readSome(path, limit);
|
buf = IO.readSome(path, limit);
|
||||||
} catch (FileNotFoundException noFile) {
|
} catch (FileNotFoundException noFile) {
|
||||||
|
|
Loading…
Reference in New Issue