summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2016-06-26 11:18:59 -0700
committerShawn Pearce <spearce@spearce.org>2016-06-26 11:18:59 -0700
commitd8603446a208c17f93ff53d529505dd7e0730477 (patch)
treeabc6a565f8b161fbecc4c6d70691a46c44cb384d /org.eclipse.jgit
parent30eb6423a2304776237ab354fe058ceb3f1d0b19 (diff)
downloadjgit-d8603446a208c17f93ff53d529505dd7e0730477.tar.gz
jgit-d8603446a208c17f93ff53d529505dd7e0730477.zip
Fix lastModified to be consistent in DfsGarbageCollector
Set all packs written by the DfsGarbageCollector to use the same starting timestamp as lastModified. This makes it easier to see which packs came from the same DfsGarbageCollector run, as they share the same timestamp. Change-Id: Id633573fbc3f0f360887b4745cacf33d6fc09320
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java
index dcfc8d523c..b7f58566e6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java
@@ -95,8 +95,8 @@ public class DfsGarbageCollector {
private long coalesceGarbageLimit = 50 << 20;
+ private long startTimeMillis;
private List<DfsPackFile> packsBefore;
-
private Set<ObjectId> allHeads;
private Set<ObjectId> nonHeads;
private Set<ObjectId> txnHeads;
@@ -190,6 +190,7 @@ public class DfsGarbageCollector {
throw new IllegalStateException(
JGitText.get().supportOnlyPackIndexVersion2);
+ startTimeMillis = System.currentTimeMillis();
ctx = (DfsReader) objdb.newReader();
try {
refdb.refresh();
@@ -422,6 +423,7 @@ public class DfsGarbageCollector {
PackStatistics stats = pw.getStatistics();
pack.setPackStats(stats);
+ pack.setLastModified(startTimeMillis);
newPackStats.add(stats);
newPackObj.add(pw.getObjectSet());