summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2013-01-05 01:21:07 +0100
committerRobin Rosenberg <robin.rosenberg@dewire.com>2013-01-05 01:23:23 +0100
commitb7d11eace6d7f0c846dfe818f9ba4cf36a8779f1 (patch)
tree4c89710b80d16bde1987c32eab5fc8b26815f245 /org.eclipse.jgit
parent5c49b93191837633fddccb23acfadfe639338643 (diff)
downloadjgit-b7d11eace6d7f0c846dfe818f9ba4cf36a8779f1.tar.gz
jgit-b7d11eace6d7f0c846dfe818f9ba4cf36a8779f1.zip
Consider that some Java version on Linux only return integral timestamps
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
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
index e16bf7ffa9..1858626cdf 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
@@ -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())