]> source.dussan.org Git - jgit.git/commitdiff
Merge branch 'stable-5.2' into stable-5.3 36/147236/2
authorMatthias Sohn <matthias.sohn@sap.com>
Thu, 8 Aug 2019 10:30:47 +0000 (12:30 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 8 Aug 2019 11:04:38 +0000 (13:04 +0200)
* stable-5.2:
  Fix OpenSshConfigTest#config
  FileSnapshot: fix bug with timestamp thresholding
  In LockFile#waitForStatChange wait in units of file time resolution
  Cache FileStoreAttributeCache per directory
  Fix FileSnapshot#save(long) and FileSnapshot#save(Instant)
  Persist minimal racy threshold and allow manual configuration
  Measure minimum racy interval to auto-configure FileSnapshot
  Reuse FileUtils to recursively delete files created by tests
  Fix FileAttributeCache.toString()
  Add test for racy git detection in FileSnapshot
  Repeat RefDirectoryTest.testGetRef_DiscoversModifiedLoose 100 times
  Fix org.eclipse.jdt.core.prefs of org.eclipse.jgit.junit
  Add missing javadoc in org.eclipse.jgit.junit
  Enhance RepeatRule to report number of failures at the end
  Fix FileSnapshotTests for filesystem with high timestamp resolution
  Retry deleting test files in FileBasedConfigTest
  Measure filesystem timestamp resolution already in test setup
  Refactor FileSnapshotTest to use NIO APIs
  Measure stored timestamp resolution instead of time to touch file
  Handle CancellationException in FileStoreAttributeCache
  Fix FileSnapshot#saveNoConfig
  Use Instant for smudge time in DirCache and DirCacheEntry
  Use Instant instead of milliseconds for filesystem timestamp handling
  Workaround SecurityException in FS#getFsTimestampResolution
  Fix NPE in FS$FileStoreAttributeCache.getFsTimestampResolution
  FS: ignore AccessDeniedException when measuring timestamp resolution
  Add debug trace for FileSnapshot
  Use FileChannel.open to touch file and set mtime to now
  Persist filesystem timestamp resolution and allow manual configuration
  Increase bazel timeout for long running tests
  Bazel: Fix lint warning flagged by buildifier
  Update bazlets to latest version
  Bazel: Add missing dependencies for ArchiveCommandTest
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  Add support for nanoseconds and microseconds for Config#getTimeUnit
  Optionally measure filesystem timestamp resolution asynchronously
  Delete unused FileTreeIteratorWithTimeControl
  FileSnapshot#equals: consider UNKNOWN_SIZE
  Timeout measuring file timestamp resolution after 2 seconds
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Deprecate Constants.CHARACTER_ENCODING in favor of
StandardCharsets.UTF_8
  Fix non-deterministic hash of archives created by ArchiveCommand
  Update Maven plugins ecj, plexus, error-prone
  Update Maven plugins and cleanup Maven warnings
  Make inner classes static where possible
  Fix API problem filters

Change-Id: I238adfd3080a5fed9d64c3c757297da6ea893918
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
29 files changed:
1  2 
WORKSPACE
lib/BUILD
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
org.eclipse.jgit.lfs.server/.settings/.api_filters
org.eclipse.jgit.packaging/pom.xml
org.eclipse.jgit.test/BUILD
org.eclipse.jgit.test/META-INF/MANIFEST.MF
org.eclipse.jgit.test/pom.xml
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergerTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java
org.eclipse.jgit/.settings/.api_filters
org.eclipse.jgit/pom.xml
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
pom.xml

diff --cc WORKSPACE
Simple merge
diff --cc lib/BUILD
Simple merge
index 2a47dd398be95dd2e0beb9415251be294bcf212b,3e60680cf74b08ad6b72c1af2daff71be29b9226..72beb7cdfa9c56de2d41bd5da77365ad3f752b8a
@@@ -3,8 -3,8 +3,8 @@@
      <resource path="META-INF/MANIFEST.MF">
          <filter id="924844039">
              <message_arguments>
-                 <message_argument value="5.3.2"/>
 -                <message_argument value="5.2.3"/>
 -                <message_argument value="5.2.0"/>
++                <message_argument value="5.3.3"/>
 +                <message_argument value="5.3.0"/>
              </message_arguments>
          </filter>
      </resource>
index f4d8c4f8e1748fd48b4dbd644141e366372e8299,cbb5ee5e9762c3c1b9aaf1c76b9bc567befa012e..22f47f59df2b6d4e0f32a1d6843acf461379b863
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
  
-   <prerequisites>
-     <maven>3.0</maven>
-   </prerequisites>
    <groupId>org.eclipse.jgit</groupId>
    <artifactId>jgit.tycho.parent</artifactId>
 -  <version>5.2.3-SNAPSHOT</version>
 +  <version>5.3.3-SNAPSHOT</version>
    <packaging>pom</packaging>
  
    <name>JGit Tycho Parent</name>
Simple merge
index 14eef1351fab0f5c5f7a1bc0c9684461f135fa92,e0d4ddaa5b5feb60c3fdfa460389f0445555900f..5533304913f3deb637b7fff6ec3c568cddb277b3
@@@ -11,55 -11,62 +11,63 @@@ Bundle-RequiredExecutionEnvironment: Ja
  Import-Package: com.googlecode.javaewah;version="[1.1.6,2.0.0)",
   com.jcraft.jsch;version="[0.1.54,0.2.0)",
   net.bytebuddy.dynamic.loading;version="[1.7.0,2.0.0)",
 - org.eclipse.jgit.annotations;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.api;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.api.errors;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.archive;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.attributes;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.awtui;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.blame;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.diff;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.dircache;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.errors;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.events;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.fnmatch;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.gitrepo;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.hooks;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.ignore;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.ignore.internal;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.internal;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.internal.fsck;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.internal.storage.dfs;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.internal.storage.file;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.internal.storage.io;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.internal.storage.pack;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.internal.storage.reftable;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.internal.storage.reftree;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.internal.transport.parser;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.junit;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.junit.ssh;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.junit.time;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.lfs;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.lib;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.merge;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.nls;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.notes;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.patch;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.pgm;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.pgm.internal;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.revplot;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.revwalk;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.revwalk.filter;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.storage.file;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.storage.pack;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.submodule;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.transport;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.transport.http;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.transport.resolver;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.treewalk;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.treewalk.filter;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.util;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.util.io;version="[5.2.3,5.3.0)",
 - org.eclipse.jgit.util.sha1;version="[5.2.3,5.3.0)",
+  org.apache.commons.compress.archivers;version="[1.15.0,2.0)",
+  org.apache.commons.compress.archivers.tar;version="[1.15.0,2.0)",
+  org.apache.commons.compress.archivers.zip;version="[1.15.0,2.0)",
+  org.apache.commons.compress.compressors.bzip2;version="[1.15.0,2.0)",
+  org.apache.commons.compress.compressors.gzip;version="[1.15.0,2.0)",
+  org.apache.commons.compress.compressors.xz;version="[1.15.0,2.0)",
 + org.bouncycastle.util.encoders;version="[1.60.0,2.0.0)",
 + org.eclipse.jgit.annotations;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.api;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.api.errors;version="[5.3.3,5.4.0)",
++ org.eclipse.jgit.archive;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.attributes;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.awtui;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.blame;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.diff;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.dircache;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.errors;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.events;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.fnmatch;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.gitrepo;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.hooks;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.ignore;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.ignore.internal;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.internal;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.internal.fsck;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.internal.storage.dfs;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.internal.storage.file;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.internal.storage.io;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.internal.storage.pack;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.internal.storage.reftable;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.internal.storage.reftree;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.internal.transport.parser;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.junit;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.junit.ssh;version="[5.3.3,5.4.0)",
++ org.eclipse.jgit.junit.time;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.lfs;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.lib;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.merge;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.nls;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.notes;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.patch;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.pgm;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.pgm.internal;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.revplot;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.revwalk;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.revwalk.filter;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.storage.file;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.storage.pack;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.submodule;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.transport;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.transport.http;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.transport.resolver;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.treewalk;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.treewalk.filter;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.util;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.util.io;version="[5.3.3,5.4.0)",
 + org.eclipse.jgit.util.sha1;version="[5.3.3,5.4.0)",
   org.junit;version="[4.12,5.0.0)",
   org.junit.experimental.theories;version="[4.12,5.0.0)",
   org.junit.rules;version="[4.12,5.0.0)",
@@@ -70,7 -77,8 +78,8 @@@
   org.mockito.junit;version="[2.13.0,3.0.0)",
   org.mockito.stubbing;version="[2.13.0,3.0.0)",
   org.objenesis;version="[2.6.0,3.0.0)",
-  org.slf4j;version="[1.7.0,2.0.0)"
+  org.slf4j;version="[1.7.0,2.0.0)",
+  org.tukaani.xz;version="[1.6.0,2.0)"
  Require-Bundle: org.hamcrest.core;bundle-version="[1.1.0,2.0.0)",
   org.hamcrest.library;bundle-version="[1.1.0,2.0.0)"
 -Export-Package: org.eclipse.jgit.transport.ssh;version="5.2.3";x-friends:="org.eclipse.jgit.ssh.apache.test"
 +Export-Package: org.eclipse.jgit.transport.ssh;version="5.3.3";x-friends:="org.eclipse.jgit.ssh.apache.test"
index 21c06428f2f163ce47df4893fc1ad88f98dec370,149663f64ef3645aea3141dfb7d0ec34327774ac..9f66d7ed735f21f80e2a3e4dd22f6c0c015f7633
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
+             <version>${maven-surefire-plugin-version}</version>
              <configuration>
 -              <argLine>-Djgit.test.long=true</argLine>
 +              <argLine>@{argLine} -Djgit.test.long=true</argLine>
              </configuration>
            </plugin>
          </plugins>
index cd96f41a4205b21336813e6b768a5868c3495220,a6072a0f5f4def9d60ec2465baca1209a997888b..e4b7ed7ba75596566d80ce0b935bc971d64b3614
@@@ -65,7 -61,7 +65,8 @@@ import org.eclipse.jgit.dircache.DirCac
  import org.eclipse.jgit.dircache.DirCacheBuilder;
  import org.eclipse.jgit.dircache.DirCacheEntry;
  import org.eclipse.jgit.junit.RepositoryTestCase;
+ import org.eclipse.jgit.junit.time.TimeUtil;
 +import org.eclipse.jgit.lib.CommitBuilder;
  import org.eclipse.jgit.lib.ConfigConstants;
  import org.eclipse.jgit.lib.Constants;
  import org.eclipse.jgit.lib.FileMode;
index a3a302d81a746e5ef35f5ec140733e288462c68a,1d3ca03178c5db6ec9bb12a00c9be705eb7ce978..9d47c7e3bc5b553b41725f1ea08cc5a7756925eb
@@@ -174,11 -176,13 +176,13 @@@ public class ObjectDirectoryTest extend
                                }
                        });
                        assertTrue(ret != null && ret.length == 1);
-                       Assume.assumeTrue(tmpFile.lastModified() == ret[0].lastModified());
+                       FS fs = db.getFS();
+                       Assume.assumeTrue(fs.lastModifiedInstant(tmpFile)
+                                       .equals(fs.lastModifiedInstant(ret[0])));
  
                        // all objects are in a new packfile but we will not detect it
 -                      assertFalse(receivingDB.hasObject(unknownID));
 -                      assertTrue(receivingDB.hasObject(id2));
 +                      assertFalse(receivingDB.getObjectDatabase().has(unknownID));
 +                      assertTrue(receivingDB.getObjectDatabase().has(id2));
                }
        }
  
index 7b3684c865925233d4bfa8f6a543502832902025,24e3bc0773ea2f66432d787fd3e9b92b8fde93e8..2357edf6cba307f6be51524caabce43077e2c8bb
@@@ -60,9 -59,9 +60,10 @@@ import static org.junit.Assert.fail
  
  import java.io.File;
  import java.io.IOException;
+ import java.time.Instant;
  import java.util.ArrayList;
  import java.util.Arrays;
 +import java.util.List;
  import java.util.Map;
  import java.util.concurrent.atomic.AtomicInteger;
  import java.util.concurrent.atomic.AtomicReference;
@@@ -671,8 -645,9 +674,9 @@@ public class RefDirectoryTest extends L
                assertEquals(B, all.get(HEAD).getObjectId());
        }
  
+       @Repeat(n = 100, abortOnFailure = false)
        @Test
 -      public void testGetRef_DiscoversModifiedLoose() throws IOException {
 +      public void testFindRef_DiscoversModifiedLoose() throws IOException {
                Map<String, Ref> all;
  
                writeLooseRef("refs/heads/master", A);
index 6f61912f2bb461060ebc1f7cdff7253693957bdc,9a0e7d2eac17554d92abaeebf40e52a4643b1d4d..754341dfea91f9f9fd05b6fa774c5eefa39900e8
@@@ -52,8 -51,8 +52,9 @@@ import static org.junit.Assume.assumeNo
  
  import java.io.File;
  import java.io.IOException;
 +import java.nio.file.InvalidPathException;
  import java.security.MessageDigest;
+ import java.time.Instant;
  
  import org.eclipse.jgit.api.Git;
  import org.eclipse.jgit.api.ResetCommand.ResetType;
index 6dfa6ef5aa1bf6a2dedc909957d39659af645ae3,2054e1efa82965e02ef8ffbf09571b395c56efe2..99d435100ba6400b01fe7fbdd3e5939a83d9eafd
@@@ -101,17 -101,16 +103,17 @@@ public class FSTest 
        public void testSymlinkAttributes() throws IOException, InterruptedException {
                Assume.assumeTrue(FS.DETECTED.supportsSymlinks());
                FS fs = FS.DETECTED;
 -              File link = new File(trash, "ä");
 -              File target = new File(trash, "å");
 -              fs.createSymLink(link, "å");
 +              File link = new File(trash, "a");
 +              File target = new File(trash, "b");
 +              fs.createSymLink(link, "b");
                assertTrue(fs.exists(link));
                String targetName = fs.readSymLink(link);
 -              assertEquals("å", targetName);
 +              assertEquals("b", targetName);
-               assertTrue(fs.lastModified(link) > 0);
+               assertTrue(fs.lastModifiedInstant(link).compareTo(EPOCH) > 0);
                assertTrue(fs.exists(link));
                assertFalse(fs.canExecute(link));
 -              assertEquals(2, fs.length(link));
 +              // The length of a symbolic link is a length of the target file path.
 +              assertEquals(1, fs.length(link));
                assertFalse(fs.exists(target));
                assertFalse(fs.isFile(target));
                assertFalse(fs.isDirectory(target));
index eb93d3e2b03c664c5be1547ed498c8ea6c926695,2c9b3fe422cbee2056654e81c25b15014594920a..2d50e3a3b512a0c0c746b6007fda8377eec3b65d
@@@ -3,8 -3,8 +3,8 @@@
      <resource path="META-INF/MANIFEST.MF">
          <filter id="924844039">
              <message_arguments>
-                 <message_argument value="5.3.2"/>
 -                <message_argument value="5.2.3"/>
 -                <message_argument value="5.2.0"/>
++                <message_argument value="5.3.3"/>
 +                <message_argument value="5.3.0"/>
              </message_arguments>
          </filter>
      </resource>
              </message_arguments>
          </filter>
      </resource>
 -    <resource path="src/org/eclipse/jgit/transport/TransferConfig.java" type="org.eclipse.jgit.transport.TransferConfig">
 -        <filter id="1159725059">
 -            <message_arguments>
 -                <message_argument value="5.1.4"/>
 -                <message_argument value="TransferConfig(Config)"/>
 -            </message_arguments>
 -        </filter>
 -        <filter id="1159725059">
 -            <message_arguments>
 -                <message_argument value="5.1.4"/>
 -                <message_argument value="TransferConfig(Repository)"/>
 -            </message_arguments>
 -        </filter>
 -    </resource>
+     <resource path="src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java" type="org.eclipse.jgit.treewalk.WorkingTreeIterator">
+         <filter id="1142947843">
+             <message_arguments>
+                 <message_argument value="5.1.9"/>
+                 <message_argument value="getEntryLastModifiedInstant()"/>
+             </message_arguments>
+         </filter>
+     </resource>
+     <resource path="src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java" type="org.eclipse.jgit.treewalk.WorkingTreeIterator$Entry">
+         <filter id="336695337">
+             <message_arguments>
+                 <message_argument value="org.eclipse.jgit.treewalk.WorkingTreeIterator.Entry"/>
+                 <message_argument value="getLastModifiedInstant()"/>
+             </message_arguments>
+         </filter>
+         <filter id="1142947843">
+             <message_arguments>
+                 <message_argument value="5.1.9"/>
+                 <message_argument value="getLastModifiedInstant()"/>
+             </message_arguments>
+         </filter>
+     </resource>
      <resource path="src/org/eclipse/jgit/util/FS.java" type="org.eclipse.jgit.util.FS">
 -        <filter id="1142947843">
 -            <message_arguments>
 -                <message_argument value="4.5.6"/>
 -                <message_argument value="fileAttributes(File)"/>
 -            </message_arguments>
 -        </filter>
          <filter id="1142947843">
              <message_arguments>
-                 <message_argument value="5.2.3"/>
-                 <message_argument value="getFsTimerResolution(Path)"/>
+                 <message_argument value="5.1.9"/>
+                 <message_argument value="getFileStoreAttributes(Path)"/>
+             </message_arguments>
+         </filter>
+         <filter id="1142947843">
+             <message_arguments>
+                 <message_argument value="5.1.9"/>
+                 <message_argument value="lastModifiedInstant(File)"/>
+             </message_arguments>
+         </filter>
+         <filter id="1142947843">
+             <message_arguments>
+                 <message_argument value="5.1.9"/>
+                 <message_argument value="lastModifiedInstant(Path)"/>
+             </message_arguments>
+         </filter>
+         <filter id="1142947843">
+             <message_arguments>
+                 <message_argument value="5.1.9"/>
+                 <message_argument value="setAsyncFileStoreAttributes(boolean)"/>
+             </message_arguments>
+         </filter>
+         <filter id="1142947843">
+             <message_arguments>
+                 <message_argument value="5.1.9"/>
+                 <message_argument value="setLastModified(Path, Instant)"/>
+             </message_arguments>
+         </filter>
+     </resource>
+     <resource path="src/org/eclipse/jgit/util/FS.java" type="org.eclipse.jgit.util.FS$Attributes">
+         <filter id="1142947843">
+             <message_arguments>
+                 <message_argument value="5.1.9"/>
+                 <message_argument value="getLastModifiedInstant()"/>
+             </message_arguments>
+         </filter>
+     </resource>
+     <resource path="src/org/eclipse/jgit/util/FS.java" type="org.eclipse.jgit.util.FS$FileStoreAttributes">
+         <filter id="1142947843">
+             <message_arguments>
+                 <message_argument value="5.1.9"/>
+                 <message_argument value="FileStoreAttributes"/>
              </message_arguments>
          </filter>
      </resource>
Simple merge
index 307fd3f310c4a61f73045dd17673e4b837eba8c2,8aa97df7772626c45b519b4d730d7da4c62dbc19..2d6228657abc49c2dd66aad6e86b00b7e6d64389
@@@ -427,9 -426,11 +428,11 @@@ public class DirCacheCheckout 
                                        // update the timestamp of the index with the one from the
                                        // file if not set, as we are sure to be in sync here.
                                        DirCacheEntry entry = i.getDirCacheEntry();
-                                       if (entry.getLastModified() == 0)
-                                               entry.setLastModified(f.getEntryLastModified());
+                                       Instant mtime = entry.getLastModifiedInstant();
+                                       if (mtime == null || mtime.equals(Instant.EPOCH)) {
+                                               entry.setLastModified(f.getEntryLastModifiedInstant());
+                                       }
 -                                      keep(entry);
 +                                      keep(entry, f);
                                }
                        } else
                                // The index contains a folder
diff --cc pom.xml
index 48abd185e692a6893693600ef7954e55ae3e2116,a7d8c8014bc5ce4f855d66b2481915d41f0fb372..275d1d634a20b88ff6a5f3a4b7af883755c91b52
+++ b/pom.xml
      <commons-compress-version>1.18</commons-compress-version>
      <osgi-core-version>4.3.1</osgi-core-version>
      <servlet-api-version>3.1.0</servlet-api-version>
 -    <jetty-version>9.4.11.v20180605</jetty-version>
 +    <jetty-version>9.4.14.v20181114</jetty-version>
-     <japicmp-version>0.13.0</japicmp-version>
+     <japicmp-version>0.14.1</japicmp-version>
 -    <httpclient-version>4.5.5</httpclient-version>
 -    <httpcore-version>4.4.9</httpcore-version>
 +    <httpclient-version>4.5.6</httpclient-version>
 +    <httpcore-version>4.4.10</httpcore-version>
      <slf4j-version>1.7.2</slf4j-version>
      <log4j-version>1.2.15</log4j-version>
      <maven-javadoc-plugin-version>3.1.0</maven-javadoc-plugin-version>
      <tycho-extras-version>1.3.0</tycho-extras-version>
      <gson-version>2.8.2</gson-version>
-     <maven-surefire-version>2.22.1</maven-surefire-version>
-     <maven-compiler-plugin-version>3.8.0</maven-compiler-plugin-version>
 +    <bouncycastle-version>1.60</bouncycastle-version>
 +    <spotbugs-maven-plugin-version>3.1.11</spotbugs-maven-plugin-version>
      <maven-project-info-reports-plugin-version>3.0.0</maven-project-info-reports-plugin-version>
      <maven-jxr-plugin-version>3.0.0</maven-jxr-plugin-version>
+     <spotbugs-maven-plugin-version>3.1.12</spotbugs-maven-plugin-version>
+     <maven-surefire-plugin-version>3.0.0-M3</maven-surefire-plugin-version>
+     <maven-surefire-report-plugin-version>${maven-surefire-plugin-version}</maven-surefire-report-plugin-version>
+     <maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
  
      <!-- Properties to enable jacoco code coverage analysis -->
      <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>${maven-project-info-reports-plugin-version}</version>
          </plugin>
+         <plugin>
+           <groupId>org.apache.maven.plugins</groupId>
+           <artifactId>maven-deploy-plugin</artifactId>
+           <version>3.0.0-M1</version>
+         </plugin>
+         <plugin>
+           <groupId>org.apache.maven.plugins</groupId>
+           <artifactId>maven-install-plugin</artifactId>
+           <version>3.0.0-M1</version>
+         </plugin>
+         <plugin>
+           <groupId>org.apache.maven.plugins</groupId>
+           <artifactId>maven-compiler-plugin</artifactId>
+           <version>${maven-compiler-plugin-version}</version>
+         </plugin>
+         <plugin>
+           <groupId>org.apache.maven.plugins</groupId>
+           <artifactId>maven-resources-plugin</artifactId>
+           <version>3.1.0</version>
+         </plugin>
 +        <plugin>
 +          <groupId>org.springframework.boot</groupId>
 +          <artifactId>spring-boot-maven-plugin</artifactId>
 +          <version>2.1.2.RELEASE</version>
 +        </plugin>
        </plugins>
      </pluginManagement>