pub struct FetchRequest {
pub wants: Vec<ObjectId>,
pub want_refs: Vec<String>,
pub haves: Vec<ObjectId>,
pub done: bool,
pub thin_pack: bool,
pub no_progress: bool,
pub include_tag: bool,
pub ofs_delta: bool,
pub filter: Option<Filter>,
pub wait_for_done: bool,
pub shallow: ShallowRequest,
}Expand description
The arguments of command=fetch, and of a v0 want section.
Fields§
§wants: Vec<ObjectId>want <oid>.
want_refs: Vec<String>want-ref <name>, the ref-in-want feature.
haves: Vec<ObjectId>have <oid>.
done: booldone: stop negotiating and send the pack.
thin_pack: boolthin-pack, and since the thin-pack ruling this one is honoured, not ignored.
Pack-copy preserves the deltas the pushing client computed, but until
2026-08-04 only those whose base was also in the transfer: the rest
were inflated and deflated whole, because allow_thin_pack: false will
not point an entry at a base the receiver may not have. On a clone
that costs nothing, since the transfer is the whole history and every
base is in it. On a negotiated fetch it is the dominant cost —
MEASURED 2026-08-04, 24 of 40 objects expanded and 3.98x stock
git’s thin pack of the same object set.
What changed is not the caution, only what backs it: the walk that
decides the transfer already knows what the client holds
(graph::Selection::client_has), so a base can now be checked
instead of assumed unsafe. A base that does not answer still costs its
object the delta. See send_pack for the three gating conditions.
no_progress: boolno-progress.
include_tag: boolinclude-tag.
ofs_delta: boolofs-delta, and since pack-copy this one is honoured, not ignored.
The pack-copy path emits an entry exactly as it found it in a pack, and
most of those entries are ofs-deltas. A client that did not ask for
ofs-delta cannot read them, so it gets whole objects instead. That is
what git-upload-pack does too: it passes --delta-base-offset to
pack-objects only when the client advertised the capability.
Every git since 2005 sends it and stock git 2.53.0 always does, so
this is the fallback, not the path. It is a real fallback though, and
tests/pack_copy.rs exercises it rather than assuming nobody lands
there.
filter: Option<Filter>filter <spec>.
wait_for_done: boolwait-for-done.
shallow: ShallowRequestEverything shallow-related.
Implementations§
Source§impl FetchRequest
impl FetchRequest
Sourcepub fn parse(
lines: &[Vec<u8>],
hash_kind: Kind,
offered: Offered,
) -> Result<Self>
pub fn parse( lines: &[Vec<u8>], hash_kind: Kind, offered: Offered, ) -> Result<Self>
Parse the argument section of command=fetch.
Unknown arguments are an error rather than a shrug. The argument table
in crate::caps is the same one the advertisement is generated from,
so “accepted here” and “advertised there” cannot drift.