pub struct FetchOptions {
pub refspecs: Vec<String>,
pub negative_refspecs: Vec<String>,
pub tags: TagMode,
pub prune: bool,
pub dry_run: bool,
pub depth: Option<u32>,
pub deepen_since: Option<String>,
pub deepen_not: Vec<String>,
pub unshallow: bool,
}Expand description
Options controlling a fetch.
Fields§
§refspecs: Vec<String>Positive refspecs selecting what to fetch.
negative_refspecs: Vec<String>Negative refspecs excluding refs from the positive set.
Tag-following policy.
prune: boolWhether to prune local tracking refs that vanished on the remote.
dry_run: boolCompute and report updates without writing any refs or objects.
depth: Option<u32>Truncate history to the given number of commits per tip
(git fetch --depth N). Drives the wire deepen N / v2 deepen arg and,
for a previously shallow repo, deepens the existing boundary. None
requests full history.
deepen_since: Option<String>Deepen history to include commits no older than this cutoff
(git fetch --shallow-since <date>). The value is sent verbatim as the
wire deepen-since <value>; callers should pass the Unix timestamp Git’s
upload-pack expects (a bare integer), not a human date string.
deepen_not: Vec<String>Deepen history but stop at (exclude) commits reachable from these refs/oids
(git fetch --shallow-exclude <ref>). Each entry is sent as a wire
deepen-not <ref>.
unshallow: boolConvert a shallow repository back into a complete one
(git fetch --unshallow). Drives the wire deepen 0x7fffffff request and
removes the local shallow boundaries that get reported as unshallow.
Implementations§
Source§impl FetchOptions
impl FetchOptions
Sourcepub fn has_deepen_request(&self) -> bool
pub fn has_deepen_request(&self) -> bool
Whether this fetch carries any shallow/deepen request (an explicit
depth/deepen-since/deepen-not/unshallow). Note this does NOT cover
the “already shallow, fetching more of the same boundary” case — that is
driven by the on-disk shallow file, checked separately by the fetch
paths via crate::shallow::load_shallow_oids.
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