pub struct FetchOptions {Show 25 fields
pub quiet: bool,
pub auto_follow_tags: bool,
pub fetch_all_tags: bool,
pub prune: bool,
pub prune_tags: bool,
pub dry_run: bool,
pub append: bool,
pub write_fetch_head: bool,
pub tag_option_explicit: bool,
pub prune_option_explicit: bool,
pub prune_tags_option_explicit: bool,
pub refmap: Option<Vec<String>>,
pub depth: Option<u32>,
pub merge_srcs: Vec<String>,
pub filter: Option<PackObjectFilter>,
pub refetch: bool,
pub cloning: bool,
pub record_promisor_refs: bool,
pub update_shallow: bool,
pub deepen_relative: bool,
pub update_head_ok: bool,
pub deepen_since: Option<i64>,
pub deepen_not: Vec<String>,
pub ssh_options: Option<SshTransportOptions>,
pub atomic: bool,
}Expand description
Controls for a fetch run, mirroring the git fetch flags the CLI parses.
Fields§
§quiet: boolSuppress prune notices (deletions still happen; only the ProgressSink
output is silenced — the caller wires that).
Auto-follow annotated tags pointing at fetched commits.
Fetch every tag (--tags), independent of reachability.
prune: boolPrune remote-tracking refs that no longer exist on the remote.
Prune local tags absent from the remote when pruning is enabled.
dry_run: boolPlan and report the fetch without installing objects or updating refs.
append: boolAppend to FETCH_HEAD instead of truncating it.
write_fetch_head: boolWrite FETCH_HEAD (the CLI’s --write-fetch-head).
tag_option_explicit: boolWhether the tag option (--tags/--no-tags) was set explicitly, so the
configured remote.<name>.tagopt must not override it.
prune_option_explicit: boolWhether the prune option (--prune/--no-prune) was set explicitly, so
the configured remote.<name>.prune/fetch.prune must not override it.
Whether the prune-tags option (--prune-tags/--no-prune-tags) was set
explicitly, so configured prune tag options must not override it.
refmap: Option<Vec<String>>Explicit --refmap mappings for command-line refspec tracking updates.
None means use remote.<name>.fetch; Some([]) disables the
opportunistic tracking update.
depth: Option<u32>Shallow fetch depth (--depth N): truncate history to N commits per tip.
None is a full fetch. Honored by the HTTP and SSH transports and by the
in-process local (file:///path) server, which computes the deepen
boundary itself (see crate::local::compute_local_deepen).
merge_srcs: Vec<String>When fetching configured remote refspecs, mark updates whose src
matches one of these (possibly-abbreviated) branch.<name>.merge values
as eligible for merge in FETCH_HEAD. More than one entry is an octopus
merge config. Empty falls back to git’s default (first ref of the first
non-pattern configured refspec). Used by fetch (current-branch merge
config) and pull.
filter: Option<PackObjectFilter>Partial-clone object filter (--filter=blob:none): omit filtered
objects from the transferred pack. Local-only today: HTTP and SSH do not
send filter requests yet, so callers that require network filtering
must gate that before calling fetch. Directly-wanted tips are always
packed on the local path, mirroring upstream’s filter traversal.
refetch: bool--refetch: ignore local haves so existing reachable commits can be
repacked under a newly requested partial-clone filter.
cloning: boolThis fetch is a clone (fetch_pack_args.cloning): shallow points sent
by a shallow server are accepted into $GIT_DIR/shallow unconditionally.
record_promisor_refs: boolWhether an in-process local promisor install should append the wanted ref
names to the .promisor sidecar. No-checkout partial clone keeps these
lines; checkout hydration leaves the final sidecar empty like upstream.
update_shallow: bool--update-shallow: accept new shallow points from a shallow server
(otherwise refs whose history needs them are rejected).
deepen_relative: bool--deepen=N: depth is relative to the client’s current boundary.
Local-only today; HTTP and SSH treat depth as an absolute --depth N.
update_head_ok: boolAllow updating the currently checked-out branch (git fetch -u /
--update-head-ok). Porcelain pull uses this internally.
deepen_since: Option<i64>--shallow-since=<date>: deepen to commits newer than the date.
Local-only today; HTTP and SSH do not send deepen-since yet.
deepen_not: Vec<String>--shallow-exclude=<ref>: deepen to commits not reachable from the ref
(resolved on the remote; a non-ref is an error, like upstream).
Local-only today; HTTP and SSH do not send deepen-not yet.
ssh_options: Option<SshTransportOptions>Command-line SSH process options supplied by a higher-level porcelain
such as clone (-4/-6). When absent, fetch derives SSH options from
the effective repository config.
atomic: bool--atomic: apply every remote-tracking ref update (and prune deletion)
in a single reference transaction so a single rejected update aborts the
whole fetch and leaves FETCH_HEAD empty. The default is non-atomic:
each ref is updated independently and a per-ref failure is reported but
does not block the others.
Trait Implementations§
Source§impl Clone for FetchOptions
impl Clone for FetchOptions
Source§fn clone(&self) -> FetchOptions
fn clone(&self) -> FetchOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more