Expand description
Pack files, indexes, and packfile I/O.
Structs§
- Local
Pack Info - Basic information about local packs.
- Pack
Data - Immutable bytes of a
.pack, pack index, commit-graph, MIDX, orpacked-refsfile. - Pack
Index - Parsed pack index with fanout-accelerated OID lookup and in-place table reads.
- Pack
Index Entry - Owned pack index row (collect from
PackIndex::iterwhen needed). - Pack
Index Entry Ref - Borrowed view of one row in a pack index.
- Pack
Lookup Options - Options controlling which local packs participate in a lookup pass.
- Reuse
Write Stats - Counters updated while streaming reused pack bytes.
- Single
Local Pack Reader - Sorted
cat-file --batchreader for repos with exactly one local pack (hot-path benchmarks). - Streaming
Reuse - Active verbatim reuse context while streaming a pack body.
- Verify
Object Record - A decoded object header record used by
verify-pack.
Enums§
- Packed
Delta Dependency - Dependency of a packed delta object at
object_offsetwithinpack_bytes. - Packed
Type - A pack object type as encoded in the packed stream header.
Constants§
- DEFAULT_
PACK_ DEPTH - Default in-pack delta chain depth when
pack.depthis unset (matches Git).
Functions§
- apply_
delta_ depth_ limit - Break only delta chains longer than
max_depthedges in a target→base map. - clear_
pack_ cache - Drop pack/MIDX caches on every registered
PackStore. - clear_
pack_ delta_ base_ cache - Drop only the process-wide delta-base LRU (indexes and pack bytes stay cached).
- collect_
local_ pack_ info - Collect aggregate local pack metrics.
- collect_
packed_ delta_ reuse_ for_ send collect_packed_delta_reuse_for_sendfunction.- compute_
fanout_ from_ entries - Compute the 256-entry fanout from owned entries (legacy helper for tests).
- compute_
fanout_ from_ oid_ slices - Compute fanout from a sorted OID list (used when writing v1 indexes in tests).
- configure_
delta_ base_ cache_ from_ config - Apply
core.deltaBaseCacheLimitfrom repository config to the process-wide delta-base LRU. - hash_
object_ bytes - Hash canonical loose object bytes (
kind SP size NUL data) with the repo hash width. - max_
verify_ pack_ delta_ depth - Longest delta-chain depth among verify-pack records (number of edges from base to tip).
- oid_
bytes_ to_ hex oid_bytes_to_hexfunction.- pack_
index_ entry_ matches_ sha1_ oid - True when
entrystores a SHA-1 OID matchingoid(SHA-256 pack entries are ignored). - pack_
index_ is_ v1 - Whether
idx_pathuses the legacy v1 pack-index format (noPACKsignature). - packed_
delta_ base_ oid packed_delta_base_oidfunction.- packed_
full_ object_ slice - When
oidis stored as a full (non-delta) object in a local pack, return its verbatim packed bytes: the varint type+size header followed by the zlib stream. - packed_
ref_ delta_ reuse_ slice - If
oidis stored asREF_DELTAorOFS_DELTAin a local pack and its base OID is inpacked_set, return the base OID and the uncompressed delta payload (Git binary delta). - parse_
pack_ index_ bytes - Parse pack index bytes (v1 or v2). When
verifyis true, check the trailing checksum. - read_
alternates_ recursive - Read alternates recursively, deduplicated in discovery order.
- read_
idx_ object_ ids - Read all object IDs from a
.idxfile. - read_
local_ pack_ indexes - Read all valid
.idxfiles inobjects/pack. - read_
local_ pack_ indexes_ cached - Read all pack indexes under
<objects_dir>/pack/from the process-wide cache. - read_
object_ from_ pack - Read an object from a pack file by its OID.
- read_
object_ from_ pack_ at_ offset - Read a packed object when the pack index entry is already known (batch cat-file workloads).
- read_
object_ from_ pack_ bytes - Resolve an object from already-loaded pack bytes (used by
verify-pack). - read_
object_ from_ pack_ into - Like
read_object_from_pack, inflating intobufand reusing its capacity. - read_
object_ from_ packs - Search all pack indexes in
objects_dirfor the given OID and read it. - read_
object_ from_ packs_ into - Like
read_object_from_packs, inflating intobufand reusing its capacity. - read_
object_ info_ from_ pack - Read
ObjectInfoforoidstored inidx’s pack without inflating the full object body. - read_
object_ info_ from_ pack_ at_ offset - Read
ObjectInfoat a known pack offset (avoids a second index lookup in batch workloads). - read_
object_ info_ from_ packs - Search local packs for
oidand return its kind and uncompressed size. - read_
pack_ bytes_ cached - Read pack file bytes from the process-wide cache.
- read_
pack_ index - Parse a pack index file (version 1 legacy or version 2), verifying the SHA-1 trailer checksum.
- read_
pack_ index_ cached - Read a single pack index from the process-wide cache (parses from disk on miss). Skips trailer verification.
- read_
pack_ index_ no_ verify - Parse a pack index file without verifying the SHA-1 trailer checksum.
- read_
packed_ delta_ dependency - If the object at
object_offsetis a delta, return how it refers to its base. - refresh_
pack_ bytes_ signature - Re-stamp the cached pack-bytes signature after deliberately touching
pack_path’s mtime (object freshening). See the internalpack_cache::refresh_pack_signaturehelper. - reprepare_
pack_ directory_ on_ miss - Re-scan the pack directory when its mtime changed since the cached listing.
- revalidate_
stale_ pack_ bytes - Re-read
pack_pathwhen its on-disk signature differs from the cached entry. - skip_
one_ pack_ object skip_one_pack_objectfunction.- slice_
one_ pack_ object - Advance
pospast one packed object (including zlib payload). - test_
pack_ cache_ guard - Serializes tests that mutate the process-global pack cache (integration tests).
- try_
read_ object_ from_ local_ packs_ cached - Resolve
oidfrom local packs via the process-wide pack cache (cached.idxparses, cached pack bytes, fanout binary search, delta-base cache). - try_
write_ streaming_ pack - Write a PACK stream to
wusing bitmap reachability and verbatim reuse when possible. - verify_
pack_ and_ collect - Verify one pack/index pair and optionally return object records.
- write_
v2_ pack_ index write_v2_pack_indexfunction.- write_
v2_ pack_ index_ with_ trailer - Write a version-2
.idxforentriesdescribing objects inpack_path.