Expand description
Immutable object/ref providers, HEAD states, ref validation and symbolic resolution.
Fetch graph validation and selection live in validation.
Structs§
- Empty
Repository - An empty repository whose HEAD points at an unborn branch.
- Indexed
Repository - Index a stable repository without allocating or copying object bodies.
- Object
Metadata - 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
ValidatedRepositoryto 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.
peeledis 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.