Expand description
Bounded HTTP fetch primitives. The host supplies transport and storage.
Smart fetch returns a validated raw pack; dumb fetch returns a zlib loose
object. Bounded loose-object decoding validates headers, lengths and IDs;
git_zero_core::zlib also provides standalone inflation, and git_zero_core::pack provides
entry/delta decoding and bounded materialized indexes. The host owns storage
and checkout policy.
Structs§
- Discovery
- Fetch
Options - Reference
- References
- Smart
Advertisement - A validated smart-HTTP advertisement. Empty repositories are valid but have no HEAD. Capabilities and reference names borrow the caller’s response.
Enums§
Traits§
Functions§
- decode_
loose - Decode exactly one loose response into caller-owned staging storage. Storage/limits include the Git header (at most 28 bytes) and body. A borrowed body is returned only after zlib, canonical header, length and ID validation. Discard staging bytes on error; concatenated streams/trailing bytes fail.
- discover
- fetch_
loose - Fetch a loose object’s zlib bytes from an ordinary HTTP repository.
- fetch_
loose_ object - Fetch and validate a dumb-HTTP loose object using independent wire and inflated buffers. The transport remains responsible for HTTP framing.
- fetch_
pack - Ask for a full reachable pack, without thin packs or sideband capabilities.
- fetch_
pack_ with_ options - Fetch distinct tips in one request. Options must match the advertisement; all wants and the checksummed response use the same object format.
- loose_
wire_ capacity - Default-zlib wire capacity, including up to 32 bytes of canonical Git header. Non-default encoders can need a separate budget; output limits are independent.
- read_
head - read_
pack_ response - Extract a checksummed, non-sideband pack after optional shallow negotiation. ACK/have negotiation and protocol v2 are intentionally outside this parser.
- read_
pack_ response_ with_ format - Validate a response in the repository’s negotiated object format, including each shallow boundary ID and the full-width pack checksum.
- read_
smart_ reference - Resume a smart advertisement at a byte cursor. Start at zero; successful reads advance past one ref, including peeled tag pseudo-refs. EOF is stable. Validate the complete advertisement with SmartAdvertisement::parse first when exposing refs incrementally to callers.
- reference_
name - Normalize HEAD, a full ref, or an unqualified branch into caller storage.
- resolve_
reference - Resolve a normalized ref using bounded GETs, without discovery.
nameis HEAD or a validated fully qualified ref. Only symbolic refs are followed; object traversal and tag peeling belong to the shared checkout layer. - write_
fetch_ request - Encode a protocol-v0 request without thin packs or sideband. Duplicate wants are omitted using bounded quadratic probes over caller-owned IDs. Invalid inputs emit nothing; discard partial output on storage/I/O error.
- write_
fetch_ request_ iter - Encode a cloneable iterator of IDs, avoiding temporary ID arrays in adapters. Duplicate probes reread the iterator; it must yield the same IDs on every clone. All wants use one format. Validation precedes any output.