/** * Compact the pack files together. * * @param pm * progress monitor to receive updates on as packing may take a * while, depending on the size of the repository. * @throws java.io.IOException * the packs cannot be compacted. */ public void compact(ProgressMonitor pm) throws IOException { if (pm == null) { pm = NullProgressMonitor.INSTANCE; } DfsObjDatabase objdb = repo.getObjectDatabase(); try (DfsReader ctx = objdb.newReader()) { if (reftableConfig != null && !srcReftables.isEmpty()) { compactReftables(ctx); } compactPacks(ctx, pm); List<DfsPackDescription> commit = getNewPacks(); Collection<DfsPackDescription> remove = toPrune(); if (!commit.isEmpty() || !remove.isEmpty()) { objdb.commitPack(commit, remove); } } finally { rw = null; } }
/** @return all of the source packs that fed into this compaction. */ public List<DfsPackDescription> getSourcePacks() { return toPrune(); }
/** * Compact the pack files together. * * @param pm * progress monitor to receive updates on as packing may take a * while, depending on the size of the repository. * @throws java.io.IOException * the packs cannot be compacted. */ public void compact(ProgressMonitor pm) throws IOException { if (pm == null) { pm = NullProgressMonitor.INSTANCE; } DfsObjDatabase objdb = repo.getObjectDatabase(); try (DfsReader ctx = objdb.newReader()) { if (reftableConfig != null && !srcReftables.isEmpty()) { compactReftables(ctx); } compactPacks(ctx, pm); List<DfsPackDescription> commit = getNewPacks(); Collection<DfsPackDescription> remove = toPrune(); if (!commit.isEmpty() || !remove.isEmpty()) { objdb.commitPack(commit, remove); } } finally { rw = null; } }