aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2025-05-09 00:18:07 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2025-05-09 19:31:56 +0000
commit4919c2b700884853653102d42da25fd2c580cf3e (patch)
treeac565b5db61c240161f16653262a872023865271
parentf96e5e3b49a19764bc8a62819216c34243105f9c (diff)
downloadjgit-master.tar.gz
jgit-master.zip
FileReftableStack: ensure new reftable files aren't missed on NFSHEADmaster
If "core.trustTablesListStat" is set to "after_open" to ensure file attributes are refreshed on NFS refreshing only the attributes of the tables.list file is not sufficient since then NFS may not detect new reftable files (stored in the same refs/reftable/ directory) which may cause FileNotFoundExceptions. Fix this by refreshing attributes of the refs/reftable/ directory. Change-Id: I7e07834fd7628a07ed644cb2740101a749d433bb
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java
index a4a1b655c5..6658575fc5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java
@@ -314,9 +314,10 @@ public class FileReftableStack implements AutoCloseable {
break;
case AFTER_OPEN:
try (InputStream stream = Files
- .newInputStream(tablesListFile.toPath())) {
- // open the tables.list file to refresh attributes (on some
- // NFS clients)
+ .newInputStream(reftableDir.toPath())) {
+ // open the refs/reftable/ directory to refresh attributes
+ // of reftable files and the tables.list file listing their
+ // names (on some NFS clients)
} catch (FileNotFoundException | NoSuchFileException e) {
// ignore
}