diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2013-01-05 01:21:07 +0100 |
---|---|---|
committer | Robin Rosenberg <robin.rosenberg@dewire.com> | 2013-01-05 01:23:23 +0100 |
commit | b7d11eace6d7f0c846dfe818f9ba4cf36a8779f1 (patch) | |
tree | 4c89710b80d16bde1987c32eab5fc8b26815f245 | |
parent | 5c49b93191837633fddccb23acfadfe639338643 (diff) | |
download | jgit-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
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java | 5 |
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()) |