]> source.dussan.org Git - jgit.git/commitdiff
Consider that some Java version on Linux only return integral timestamps 77/9477/2
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Sat, 5 Jan 2013 00:21:07 +0000 (01:21 +0100)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Sat, 5 Jan 2013 00:23:23 +0000 (01:23 +0100)
This logic is similar to what we do on Windows, but in this case it's
Java that truncates the timestamps, not Git.

Bug: 395410
Change-Id: Ie55dcb9fa583f5c3dd10d7a1b582e5b04b45858d

org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java

index e16bf7ffa9d2578d320db9e1c645b8592cd5b2a8..1858626cdfc68b6c80693efd179b380f8e78c98c 100644 (file)
@@ -759,7 +759,10 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
                long fileLastModified = getEntryLastModified();
                if (cacheLastModified % 1000 == 0)
                        fileLastModified = fileLastModified - fileLastModified % 1000;
-
+               // Some Java version on Linux return whole seconds only even when
+               // the file systems supports more precision.
+               else if (fileLastModified % 1000 == 0)
+                       cacheLastModified = cacheLastModified - cacheLastModified % 1000;
                if (fileLastModified != cacheLastModified)
                        return MetadataDiff.DIFFER_BY_TIMESTAMP;
                else if (!entry.isSmudged())