|
|
@ -70,6 +70,7 @@ import org.eclipse.jgit.lib.ObjectId; |
|
|
|
import org.eclipse.jgit.lib.ObjectIdSet; |
|
|
|
import org.eclipse.jgit.lib.ObjectIdSet; |
|
|
|
import org.eclipse.jgit.lib.ProgressMonitor; |
|
|
|
import org.eclipse.jgit.lib.ProgressMonitor; |
|
|
|
import org.eclipse.jgit.lib.Ref; |
|
|
|
import org.eclipse.jgit.lib.Ref; |
|
|
|
|
|
|
|
import org.eclipse.jgit.lib.RefDatabase; |
|
|
|
import org.eclipse.jgit.revwalk.RevWalk; |
|
|
|
import org.eclipse.jgit.revwalk.RevWalk; |
|
|
|
import org.eclipse.jgit.storage.pack.PackConfig; |
|
|
|
import org.eclipse.jgit.storage.pack.PackConfig; |
|
|
|
import org.eclipse.jgit.storage.pack.PackStatistics; |
|
|
|
import org.eclipse.jgit.storage.pack.PackStatistics; |
|
|
@ -78,9 +79,7 @@ import org.eclipse.jgit.util.io.CountingOutputStream; |
|
|
|
/** Repack and garbage collect a repository. */ |
|
|
|
/** Repack and garbage collect a repository. */ |
|
|
|
public class DfsGarbageCollector { |
|
|
|
public class DfsGarbageCollector { |
|
|
|
private final DfsRepository repo; |
|
|
|
private final DfsRepository repo; |
|
|
|
|
|
|
|
private final RefDatabase refdb; |
|
|
|
private final DfsRefDatabase refdb; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final DfsObjDatabase objdb; |
|
|
|
private final DfsObjDatabase objdb; |
|
|
|
|
|
|
|
|
|
|
|
private final List<DfsPackDescription> newPackDesc; |
|
|
|
private final List<DfsPackDescription> newPackDesc; |
|
|
@ -195,7 +194,7 @@ public class DfsGarbageCollector { |
|
|
|
|
|
|
|
|
|
|
|
ctx = (DfsReader) objdb.newReader(); |
|
|
|
ctx = (DfsReader) objdb.newReader(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
refdb.clearCache(); |
|
|
|
refdb.refresh(); |
|
|
|
objdb.clearCache(); |
|
|
|
objdb.clearCache(); |
|
|
|
|
|
|
|
|
|
|
|
refsBefore = refdb.getRefs(ALL); |
|
|
|
refsBefore = refdb.getRefs(ALL); |
|
|
|