import static org.junit.Assert.fail;
import java.io.IOException;
+import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
gc = new DfsGarbageCollector(repo);
gc.setReftableConfig(new ReftableConfig());
// Expire ref log entries older than 30 days
- gc.setRefLogExpire(new Date(thirty_days_ago));
+ gc.setRefLogExpire(Instant.ofEpochMilli(thirty_days_ago));
run(gc);
// Single GC pack present with all objects.
import static org.eclipse.jgit.internal.storage.pack.PackWriter.NONE;
import java.io.IOException;
+import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
-import java.util.Date;
import java.util.EnumSet;
import java.util.GregorianCalendar;
import java.util.HashSet;
private Set<ObjectId> allTags;
private Set<ObjectId> nonHeads;
private Set<ObjectId> tagTargets;
- private Date refLogExpire;
+ private Instant refLogExpire;
/**
* Initialize a garbage collector.
* instant in time which defines refLog expiration
* @return {@code this}
*/
- public DfsGarbageCollector setRefLogExpire(Date refLogExpire) {
- this.refLogExpire = refLogExpire ;
+ public DfsGarbageCollector setRefLogExpire(Instant refLogExpire) {
+ this.refLogExpire = refLogExpire;
return this;
}
compact.setIncludeDeletes(includeDeletes);
compact.setConfig(configureReftable(reftableConfig, out));
if(refLogExpire != null ){
- compact.setReflogExpireOldestReflogTimeMillis(refLogExpire.getTime());
+ compact.setReflogExpireOldestReflogTimeMillis(
+ refLogExpire.toEpochMilli());
}
compact.compact();
pack.addFileExt(REFTABLE);