pub fn write_pack_for_push(
odb: &Odb,
wants: &[ObjectId],
haves: &[ObjectId],
opts: &PackBuildOptions,
w: &mut dyn Write,
) -> Result<PackStats>Expand description
Stream the pack a push sends to w: the objects reachable from wants but not
from haves, bounded by the have tips as in build_pack_for_push.
Memory stays bounded by the object list rather than the pack size: on-disk deltas and whole objects are copied from the source packs batch by batch, and every phase shares one mapping of each source pack.
§Parameters
odb: the object database the objects are read from.wants: the new tips the remote should end up with.haves: objects the remote already holds (its tips and.haves), all present inodb.opts: delta, thin-pack and offset-delta settings for the remote.w: where the PACK v2 stream, trailer included, is written.
§Returns
Object and byte counts of the pack written.
§Errors
Missing wants, corrupt objects, or Error::Io when writing to w fails.