]> source.dussan.org Git - jgit.git/commitdiff
Revert "RefDirectory.scanRef: Re-use file existence check done in snapshot creation" 35/189135/1
authorThomas Wolf <thomas.wolf@paranor.ch>
Sun, 26 Dec 2021 14:35:30 +0000 (15:35 +0100)
committerThomas Wolf <thomas.wolf@paranor.ch>
Sun, 26 Dec 2021 14:38:26 +0000 (15:38 +0100)
This reverts commit f829f5f838e0f9c17373ea6cb3407976a8f395ff.

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>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java

index 654e98d817efc1b3036918237f68e84a3a704261..487ae06014ad37df7c8776e899dffce724f98ade 100644 (file)
@@ -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() {
index c34be9cc0a2d8a3ec1b860061ff33c6b16e0d6c7..0b8e0797ef14fcedc2b36f18b14b0423e1a4cae0 100644 (file)
@@ -1103,10 +1103,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) {