summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2021-12-26 15:51:23 +0100
committerThomas Wolf <thomas.wolf@paranor.ch>2021-12-26 15:52:03 +0100
commit7edb062d8c3d6375c25463d43b5b0ade8a7778ee (patch)
treeeb79ec0efbd73cf0266a711e94449fa70dcbf814
parentdc41de0e3cddf816ebaf0fe2e78a8b4cbe40bf5a (diff)
parentf2d4783c5256b8ad925aa548c70d53d0ec1d88ce (diff)
downloadjgit-7edb062d8c3d6375c25463d43b5b0ade8a7778ee.tar.gz
jgit-7edb062d8c3d6375c25463d43b5b0ade8a7778ee.zip
Merge branch 'stable-5.2' into stable-5.3
* stable-5.2: Revert "RefDirectory.scanRef: Re-use file existence check done in snapshot creation" Change-Id: Id37f47a5ef2e3c8329eca30c171941f7e5606a85 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java4
2 files changed, 0 insertions, 13 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java
index 654e98d817..487ae06014 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java
@@ -439,15 +439,6 @@ public class FileSnapshot {
return equals(other);
}
- /**
- * Check if the file exists
- *
- * @return true if the file exists
- */
- public boolean fileExists() {
- return !MISSING_FILEKEY.equals(this.fileKey);
- }
-
/** {@inheritDoc} */
@Override
public int hashCode() {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
index 8f646220d3..9542025dfd 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
@@ -1122,10 +1122,6 @@ public class RefDirectory extends RefDatabase {
final int limit = 4096;
final byte[] buf;
FileSnapshot otherSnapshot = FileSnapshot.save(path);
- if (!otherSnapshot.fileExists()) {
- return null;
- }
-
try {
buf = IO.readSome(path, limit);
} catch (FileNotFoundException noFile) {