pub struct FetchOptions {Show 17 fields
pub quiet: bool,
pub auto_follow_tags: bool,
pub fetch_all_tags: bool,
pub prune: bool,
pub dry_run: bool,
pub append: bool,
pub write_fetch_head: bool,
pub tag_option_explicit: bool,
pub prune_option_explicit: bool,
pub depth: Option<u32>,
pub merge_srcs: Vec<String>,
pub filter: Option<PackObjectFilter>,
pub cloning: bool,
pub update_shallow: bool,
pub deepen_relative: bool,
pub deepen_since: Option<i64>,
pub deepen_not: Vec<String>,
}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.
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.
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.
cloning: boolThis fetch is a clone (fetch_pack_args.cloning): shallow points sent
by a shallow server are accepted into $GIT_DIR/shallow unconditionally.
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.
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.
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