From 32e0e27bec4f2aec62ca9e049600419fef1031f8 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Tue, 6 May 2025 11:56:56 +0200 Subject: PlotRefComparator: fix #timeof The #timeof method returned - the commit time in seconds since the epoch for RevCommits - the tagger time in milliseconds since the epoch for annotated tags Fix this by converting commit time to milliseconds to ensure consistent timestamp comparison of tags and commits. Change-Id: I91621da19c234fe823788d85e4077750cb5cba1a --- org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java index 39e8fd8634..c8c454a228 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java @@ -169,8 +169,9 @@ public class PlotWalk extends RevWalk { } long timeof(RevObject o) { - if (o instanceof RevCommit) - return ((RevCommit) o).getCommitTime(); + if (o instanceof RevCommit) { + return ((RevCommit) o).getCommitTime() * 1000L; + } if (o instanceof RevTag) { RevTag tag = (RevTag) o; try { -- cgit v1.2.3