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 */); } }
/** * Prepare the list of objects to be written to the pack stream. * <p> * Basing on these 2 sets, another set of objects to put in a pack file is * created: this set consists of all objects reachable (ancestors) from * interesting objects, except uninteresting objects and their ancestors. * This method uses class {@link org.eclipse.jgit.revwalk.ObjectWalk} * extensively to find out that appropriate set of output objects and their * optimal order in output pack. Order is consistent with general git * in-pack rules: sort by object type, recency, path and delta-base first. * </p> * * @param countingMonitor * progress during object enumeration. * @param want * collection of objects to be marked as interesting (start * points of graph traversal). Must not be {@code null}. * @param have * collection of objects to be marked as uninteresting (end * points of graph traversal). Pass {@link #NONE} if all objects * reachable from {@code want} are desired, such as when serving * a clone. * @throws java.io.IOException * when some I/O problem occur during reading objects. */ public void preparePack(ProgressMonitor countingMonitor, @NonNull Set<? extends ObjectId> want, @NonNull Set<? extends ObjectId> have) throws IOException { preparePack(countingMonitor, want, have, NONE, NONE); }
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)); } }
if (exc.size() == 0) packWriter.setTagTargets(tagTargets); packWriter.preparePack(monitor, inc, exc);
@NonNull Set<? extends ObjectId> have, @NonNull Set<? extends ObjectId> shallow) throws IOException { preparePack(countingMonitor, want, have, shallow, NONE);
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(); } } }
for (ObjectIdSet idx : excludeObjects) pw.excludeObjects(idx); pw.preparePack(pm, want, have, PackWriter.NONE, tags); if (pw.getObjectCount() == 0) return null;
have.add(r.getPeeledObjectId()); writer.preparePack(monitor, need, have);
writer.setReuseValidatingObjects(false); writer.setDeltaBaseAsOffset(capableOfsDelta); writer.preparePack(monitor, newObjects, remoteObjects);
try (ObjectWalk ow = getObjectWalk()) { ow.assumeShallow(shallow); preparePack(countingMonitor, ow, want, have, noBitmaps);
pw.preparePack(pm, wantIds, commonBase, req.getClientShallowCommits()); } else { pw.preparePack(pm, ow, wantAll, commonBase, PackWriter.NONE); rw = ow;
@NonNull Set<? extends ObjectId> want, @NonNull Set<? extends ObjectId> have) throws IOException { preparePack(countingMonitor, want, have, Collections.<ObjectId> emptySet());
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 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 */); } }
/** * Prepare the list of objects to be written to the pack stream. * <p> * Basing on these 2 sets, another set of objects to put in a pack file is * created: this set consists of all objects reachable (ancestors) from * interesting objects, except uninteresting objects and their ancestors. * This method uses class {@link org.eclipse.jgit.revwalk.ObjectWalk} * extensively to find out that appropriate set of output objects and their * optimal order in output pack. Order is consistent with general git * in-pack rules: sort by object type, recency, path and delta-base first. * </p> * * @param countingMonitor * progress during object enumeration. * @param want * collection of objects to be marked as interesting (start * points of graph traversal). Must not be {@code null}. * @param have * collection of objects to be marked as uninteresting (end * points of graph traversal). Pass {@link #NONE} if all objects * reachable from {@code want} are desired, such as when serving * a clone. * @throws java.io.IOException * when some I/O problem occur during reading objects. */ public void preparePack(ProgressMonitor countingMonitor, @NonNull Set<? extends ObjectId> want, @NonNull Set<? extends ObjectId> have) throws IOException { preparePack(countingMonitor, want, have, NONE, NONE); }
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(); } } }
for (Ref r : db.getAllRefs().values()) all.add(r.getObjectId()); pw.preparePack(m, all, PackWriter.NONE);