Skip to main content

Module pack

Module pack 

Source
Expand description

Pack and pack-index helpers for object counting and verification.

This module implements a focused subset of pack functionality required by count-objects, verify-pack, and show-index.

Structs§

LocalPackInfo
Basic information about local packs.
PackIndex
Parsed data from a .idx file (version 2).
PackIndexEntry
A parsed entry from an index file.
ShowIndexEntry
A single entry produced by show-index, with an optional CRC32.
VerifyObjectRecord
A decoded object header record used by verify-pack.

Enums§

PackedType
A pack object type as encoded in the packed stream header.

Functions§

collect_local_pack_info
Collect aggregate local pack metrics.
packed_delta_base_oid
packed_ref_delta_reuse_slice
When oid is stored as a delta in a pack, return its delta base object id. Returns None for loose objects and for non-delta packed objects. If oid is stored as REF_DELTA or OFS_DELTA in a local pack and its base OID is in packed_set, return the base OID and the uncompressed delta payload (Git binary delta).
read_alternates_recursive
Read alternates recursively, deduplicated in discovery order.
read_idx_object_ids
Read all object IDs from a .idx file.
read_local_pack_indexes
Read all valid .idx files in objects/pack.
read_object_from_pack
Read an object from a pack file by its OID.
read_object_from_packs
Search all pack indexes in objects_dir for the given OID and read it.
read_pack_index
Parse a version-2 pack index file.
show_index_entries
Parse a pack index from a reader (e.g. stdin) and return all entries in index order.
skip_one_pack_object
Advance pos past one packed object (including zlib payload).
verify_pack_and_collect
Verify one pack/index pair and optionally return object records.