]> source.dussan.org Git - jgit.git/commit
Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL 66/149266/1
authorMatthias Sohn <matthias.sohn@sap.com>
Tue, 10 Sep 2019 14:08:45 +0000 (16:08 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 10 Sep 2019 14:08:45 +0000 (16:08 +0200)
commit84ac86ee61989bab441904e3e72b2b98199cccfc
tree970db5ebd3c2304e573aa186de7bbce1cc1c48b7
parentf042270e65bbb62dd50aeb5bf8c5f8e181acdebb
Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL

If CheckStat is MINIMAL or timestamps have no nanosecond part
WorkingTreeIterator.compareMetaData only checks the second part of
timestamps and ignores nanoseconds which may have ended up in the index
by using native git.

If

fileLastModified.getEpochSecond() == cacheLastModified.getEpochSecond()

we currently proceed comparing fileLastModified and cacheLastModified
with full precision which is wrong since we determined that we detected
reduced timestamp resolution.

Fix this and also handle smudged index entries for CheckStat.MINIMAL.

Change-Id: I6149885903ac63d79b42d234cc02aa4e19578f3c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java