Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Milanesio2019-03-12 03:00:01 -0400
committerMatthias Sohn2019-03-12 10:06:04 -0400
commit2d116cd0ab5f68613da8be4907460089c6f1fa22 (patch)
treecbb8662c73305800b6df910c2220a7bd1a5fc5ba
parent2dc572df24c58ae8bf9019f7fd10459d3d53779d (diff)
downloadjgit-2d116cd0ab5f68613da8be4907460089c6f1fa22.tar.gz
jgit-2d116cd0ab5f68613da8be4907460089c6f1fa22.tar.xz
jgit-2d116cd0ab5f68613da8be4907460089c6f1fa22.zip
Use FileSnapshot to get lastModified on PackFile
Do not redundantly call File.lastModified() for extracting the timestamp of the PackFile but rather use consistently the FileSnapshot which reads all file attributes in a single bulk call. Change-Id: I932675ae4fe56dcd3833dac249816f097303bb09 Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java
index 9a1d12f407..2ca9e83f1c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java
@@ -164,8 +164,8 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
*/
public PackFile(final File packFile, int extensions) {
this.packFile = packFile;
- this.packLastModified = (int) (packFile.lastModified() >> 10);
this.fileSnapshot = FileSnapshot.save(packFile);
+ this.packLastModified = (int) (fileSnapshot.lastModified() >> 10);
this.extensions = extensions;
// Multiply by 31 here so we can more directly combine with another

Back to the top