diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-12-26 16:05:17 +0100 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-12-26 16:06:00 +0100 |
commit | f77519775d7cd5638be71e91f70ff11fd653e6c5 (patch) | |
tree | 2fa6e5201a1705c5d4ea6de7e9fd44473a7e1bc7 /org.eclipse.jgit/src/org/eclipse/jgit | |
parent | ab8a5a3ccbb31d3aec4199f17b950096460940e0 (diff) | |
parent | 7146bde45fa2b2d6c15e688ef90f50b4a576451f (diff) | |
download | jgit-f77519775d7cd5638be71e91f70ff11fd653e6c5.tar.gz jgit-f77519775d7cd5638be71e91f70ff11fd653e6c5.zip |
Merge branch 'stable-6.0'
* stable-6.0:
Revert "RefDirectory.scanRef: Re-use file existence check done in snapshot creation"
TreeRevFilter: fix wrong stop when the given path disappears
Change-Id: Id7540d03991cdcf6f405e946b8cbbcc6a9696a31
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
3 files changed, 4 insertions, 14 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 5ab973f533..6088c152a1 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 @@ -420,15 +420,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 2167262dd5..07e38147f7 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 @@ -1092,10 +1092,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) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java index e465024311..822fc5320c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java @@ -211,7 +211,10 @@ public class TreeRevFilter extends RevFilter { // "empty tree root" and thus their history is not relevant. // Cut our grandparents to be an empty list. // - pList[i].parents = RevCommit.NO_PARENTS; + tw.reset(pList[i].getTree()); + if (!tw.next()) { + pList[i].parents = RevCommit.NO_PARENTS; + } } // We have an interesting difference relative to this parent. |