Skip to main content

Module repository

Module repository 

Source
Expand description

Immutable object/ref providers, HEAD states, ref validation and symbolic resolution. Fetch graph validation and selection live in validation.

Structs§

EmptyRepository
An empty repository whose HEAD points at an unborn branch.
IndexedRepository
Index a stable repository without allocating or copying object bodies.
ObjectMetadata
A borrowed object and its precomputed ID, stored in caller-owned memory.
RefRepository
Attach a caller-owned sorted ref manifest and HEAD to an object provider. Construction validates refs and symbolic links, without reading object bodies. Use ValidatedRepository to check IDs, target kinds, tags and the union graph.
Reference
One resolved advertised ref, with optional symbolic and annotated-tag data. Symbolic targets must exist, resolve without cycles, and have the same ID. peeled is the final non-tag object ID, including through nested tags.

Enums§

Head
HEAD’s resolved commit and optional symbolic branch target.

Constants§

MAX_HEAD_REF_LENGTH
Maximum SHA-1 default branch size, including its HEAD capability packet.
MAX_PEELED_REF_LENGTH
A peeled advertisement appends ^{} to the stored ref name.
MAX_REF_NAME_LENGTH
Maximum SHA-1 ref name size that fits a smart HTTP advertisement.
MAX_UNBORN_REF_LENGTH
Maximum SHA-1 unborn branch size, including the empty capabilities marker.
UPLOAD_CAPABILITIES
V0 upload capabilities, including their leading separator. Shared with the server so repository ref-name limits include the complete advertisement.

Traits§

Repository
A stable snapshot containing the union reachable from HEAD and advertised refs.

Functions§

head_ref_limit
ref_name_limit
resolve_reference
Resolve a named symbolic ref using a bounded number of manifest probes.
unborn_ref_limit
uses_only_head
Complete-pack HEAD keys are safe only when every ref aliases that HEAD.
validate_ref_name
Validate a fully qualified ref name that fits a smart advertisement. The default branch additionally needs to fit MAX_HEAD_REF_LENGTH.
validate_ref_name_bytes
Validate a raw fully qualified ref name, including non-UTF-8 Git names.
validate_refs
Validate a repository’s advertised refs, symbolic links and HEAD state. Names must be valid, sorted, unique, free of path conflicts, and include a resolved symbolic HEAD’s branch. Unborn HEAD’s target must be absent. Object identities and graph closure are checked separately by the validator.