diff options
author | Shawn Pearce <spearce@spearce.org> | 2017-02-20 10:30:58 -0800 |
---|---|---|
committer | Shawn Pearce <spearce@spearce.org> | 2017-02-20 10:30:58 -0800 |
commit | ff6e6c2214dc4b68e6754c3d1a8fc964ad6eab41 (patch) | |
tree | ee8da774123e49f09715be8b512bd62873ad0b09 | |
parent | fceac7e44d53d6b0ac56be9d5d4ac6607cdd5878 (diff) | |
download | jgit-ff6e6c2214dc4b68e6754c3d1a8fc964ad6eab41.tar.gz jgit-ff6e6c2214dc4b68e6754c3d1a8fc964ad6eab41.zip |
Fix timestamp in Zip archives
RevCommit.getCommitTime returns time in seconds since the epoch.
ZipArchiveEntry.setTime expects time in milliseconds.
Add the missing unit conversion to get the correct result.
Correct formatting to be consistent with the rest of the code.
Change-Id: I990b92f1d996ec8538d4857755694d91b142eb53
-rw-r--r-- | org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java index 7cce19702c..46d918ed70 100644 --- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java +++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java @@ -109,9 +109,9 @@ public final class ZipFormat extends BaseFormat implements final ZipArchiveEntry entry = new ZipArchiveEntry(path); - if(tree instanceof RevCommit){ - long commitTime = ((RevCommit) tree).getCommitTime(); - entry.setTime(commitTime); + if (tree instanceof RevCommit) { + long t = ((RevCommit) tree).getCommitTime() * 1000L; + entry.setTime(t); } if (mode == FileMode.TREE) { |