Skip to main content

unpack_objects

Function unpack_objects 

Source
pub fn unpack_objects(
    reader: &mut dyn Read,
    odb: &Odb,
    opts: &UnpackOptions,
) -> Result<usize>
Expand description

Unpack a pack stream from reader into odb.

Reads the complete pack from reader, validates the trailing SHA-1 checksum, unpacks all objects (including full delta-chain resolution), and — unless UnpackOptions::dry_run is set — writes each object to odb.

With a files-backed primary every object is written as a loose object in this object directory, even when an alternate already has it. With a custom OdbBuilder::primary objects go to that store through Odb::write.

Returns the total number of objects processed.

§Errors