Skip to main content

FetchOptions

Struct FetchOptions 

Source
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: bool

Suppress prune notices (deletions still happen; only the ProgressSink output is silenced — the caller wires that).

§auto_follow_tags: bool

Auto-follow annotated tags pointing at fetched commits.

§fetch_all_tags: bool

Fetch every tag (--tags), independent of reachability.

§prune: bool

Prune remote-tracking refs that no longer exist on the remote.

§dry_run: bool

Plan and report the fetch without installing objects or updating refs.

§append: bool

Append to FETCH_HEAD instead of truncating it.

§write_fetch_head: bool

Write FETCH_HEAD (the CLI’s --write-fetch-head).

§tag_option_explicit: bool

Whether the tag option (--tags/--no-tags) was set explicitly, so the configured remote.<name>.tagopt must not override it.

§prune_option_explicit: bool

Whether 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: bool

This 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

Source§

fn clone(&self) -> FetchOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FetchOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.