private void packRefTreeGraph(ProgressMonitor pm) throws IOException { if (txnHeads.isEmpty()) return; try (PackWriter pw = newPackWriter()) { for (ObjectIdSet packedObjs : newPackObj) pw.excludeObjects(packedObjs); pw.preparePack(pm, txnHeads, NONE); if (0 < pw.getObjectCount()) writePack(GC_TXN, pw, pm, 0 /* unknown pack size */); } }
private void packRest(ProgressMonitor pm) throws IOException { if (nonHeads.isEmpty()) return; try (PackWriter pw = newPackWriter()) { for (ObjectIdSet packedObjs : newPackObj) pw.excludeObjects(packedObjs); pw.preparePack(pm, nonHeads, allHeadsAndTags); if (0 < pw.getObjectCount()) writePack(GC_REST, pw, pm, estimateGcPackSize(INSERT, RECEIVE, COMPACT, GC_REST)); } }
private void packHeads(ProgressMonitor pm) throws IOException { if (allHeadsAndTags.isEmpty()) { writeReftable(); return; } try (PackWriter pw = newPackWriter()) { pw.setTagTargets(tagTargets); pw.preparePack(pm, allHeadsAndTags, NONE, NONE, allTags); if (0 < pw.getObjectCount()) { long estSize = estimateGcPackSize(INSERT, RECEIVE, COMPACT, GC); writePack(GC, pw, pm, estSize); } else { writeReftable(); } } }
pw.excludeObjects(idx); pw.preparePack(pm, want, have, PackWriter.NONE, tags); if (pw.getObjectCount() == 0) return null; checkCancelled();
if (writer.getObjectCount() == 0) return;
if (!canBuildBitmaps || getObjectCount() > Integer.MAX_VALUE || !cachedPacks.isEmpty()) return false;
this); long objCnt = getObjectCount(); stats.totalObjects = objCnt; if (callback != null)
if (pw.getObjectCount() == 0) { return;
if (0 < pw.getObjectCount()) writePack(UNREACHABLE_GARBAGE, pw, pm, estimatedPackSize);
private void packRefTreeGraph(ProgressMonitor pm) throws IOException { if (txnHeads.isEmpty()) return; try (PackWriter pw = newPackWriter()) { for (ObjectIdSet packedObjs : newPackObj) pw.excludeObjects(packedObjs); pw.preparePack(pm, txnHeads, NONE); if (0 < pw.getObjectCount()) writePack(GC_TXN, pw, pm, 0 /* unknown pack size */); } }
private void packHeads(ProgressMonitor pm) throws IOException { if (allHeads.isEmpty()) return; try (PackWriter pw = newPackWriter()) { pw.setTagTargets(tagTargets); pw.preparePack(pm, allHeads, PackWriter.NONE); if (0 < pw.getObjectCount()) writePack(GC, pw, pm); } }
private void packRest(ProgressMonitor pm) throws IOException { if (nonHeads.isEmpty()) return; try (PackWriter pw = newPackWriter()) { for (ObjectIdSet packedObjs : newPackObj) pw.excludeObjects(packedObjs); pw.preparePack(pm, nonHeads, allHeads); if (0 < pw.getObjectCount()) writePack(GC_REST, pw, pm); } }
private void packRefTreeGraph(ProgressMonitor pm) throws IOException { if (txnHeads.isEmpty()) return; try (PackWriter pw = newPackWriter()) { for (ObjectIdSet packedObjs : newPackObj) pw.excludeObjects(packedObjs); pw.preparePack(pm, txnHeads, PackWriter.NONE); if (0 < pw.getObjectCount()) writePack(GC_TXN, pw, pm); } }
private void packRest(ProgressMonitor pm) throws IOException { if (nonHeads.isEmpty()) return; try (PackWriter pw = newPackWriter()) { for (ObjectIdSet packedObjs : newPackObj) pw.excludeObjects(packedObjs); pw.preparePack(pm, nonHeads, allHeadsAndTags); if (0 < pw.getObjectCount()) writePack(GC_REST, pw, pm, estimateGcPackSize(INSERT, RECEIVE, COMPACT, GC_REST)); } }
private void packHeads(ProgressMonitor pm) throws IOException { if (allHeadsAndTags.isEmpty()) { writeReftable(); return; } try (PackWriter pw = newPackWriter()) { pw.setTagTargets(tagTargets); pw.preparePack(pm, allHeadsAndTags, NONE, NONE, allTags); if (0 < pw.getObjectCount()) { long estSize = estimateGcPackSize(INSERT, RECEIVE, COMPACT, GC); writePack(GC, pw, pm, estSize); } else { writeReftable(); } } }
if (pw.getObjectCount() == 0) { List<DfsPackDescription> remove = toPrune(); if (remove.size() > 0)
if (!canBuildBitmaps || getObjectCount() > Integer.MAX_VALUE || !cachedPacks.isEmpty()) return false;
if (pw.getObjectCount() == 0) { return;
private void packGarbage(ProgressMonitor pm) throws IOException { PackConfig cfg = new PackConfig(packConfig); cfg.setReuseDeltas(true); cfg.setReuseObjects(true); cfg.setDeltaCompress(false); cfg.setBuildBitmaps(false); try (PackWriter pw = new PackWriter(cfg, ctx); RevWalk pool = new RevWalk(ctx)) { pw.setDeltaBaseAsOffset(true); pw.setReuseDeltaCommits(true); pm.beginTask(JGitText.get().findingGarbage, objectsBefore()); for (DfsPackFile oldPack : packsBefore) { PackIndex oldIdx = oldPack.getPackIndex(ctx); for (PackIndex.MutableEntry ent : oldIdx) { pm.update(1); ObjectId id = ent.toObjectId(); if (pool.lookupOrNull(id) != null || anyPackHas(id)) continue; int type = oldPack.getObjectType(ctx, ent.getOffset()); pw.addObject(pool.lookupAny(id, type)); } } pm.endTask(); if (0 < pw.getObjectCount()) writePack(UNREACHABLE_GARBAGE, pw, pm); } }
if (0 < pw.getObjectCount()) writePack(UNREACHABLE_GARBAGE, pw, pm, estimatedPackSize);