Skip to main content

Crate git_zero_client

Crate git_zero_client 

Source
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
FetchOptions
Reference
References
SmartAdvertisement
A validated smart-HTTP advertisement. Empty repositories are valid but have no HEAD. Capabilities and reference names borrow the caller’s response.

Enums§

Protocol

Traits§

Transport

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. name is 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.