Skip to content

Commit 4919c2b

Browse files
committed
FileReftableStack: ensure new reftable files aren't missed on NFS
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
1 parent f96e5e3 commit 4919c2b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,10 @@ boolean isUpToDate() throws IOException {
314314
break;
315315
case AFTER_OPEN:
316316
try (InputStream stream = Files
317-
.newInputStream(tablesListFile.toPath())) {
318-
// open the tables.list file to refresh attributes (on some
319-
// NFS clients)
317+
.newInputStream(reftableDir.toPath())) {
318+
// open the refs/reftable/ directory to refresh attributes
319+
// of reftable files and the tables.list file listing their
320+
// names (on some NFS clients)
320321
} catch (FileNotFoundException | NoSuchFileException e) {
321322
// ignore
322323
}

0 commit comments

Comments
 (0)