Skip to main content

write_bundle

Function write_bundle 

Source
pub fn write_bundle(
    repo: &Repository,
    spec: &BundleSpec,
    out: &mut dyn Write,
) -> Result<(), BundleError>
Expand description

Write a bundle to out from repo using spec.

The header is written first, then the pack is streamed straight into out; the pack is never held in memory as a whole (filtered bundles excepted). Deltas and whole objects already stored in local packs are copied verbatim rather than recomputed, and bundles with prerequisites are thin (deltas may name a prerequisite-reachable base the recipient already holds). Pass a buffered writer: the pack is emitted in many small writes.

ยงErrors

Returns BundleError::EmptyRefs when spec.include is empty, or I/O / pack errors.