Skip to main content

PullOptions

Struct PullOptions 

Source
pub struct PullOptions {
    pub remote: Option<String>,
    pub branch: Option<String>,
    pub explicit_fetch: bool,
    pub autostash: bool,
    pub check: bool,
    pub mode: Option<PullMode>,
    pub fetch: FetchOptions,
    pub upstream: Option<FetchedUpstream>,
    pub stop_on_conflict: bool,
}
Expand description

Options for pull.

Fields§

§remote: Option<String>

Remote name override; when None, uses configured_remote_for_pull.

§branch: Option<String>

Remote branch or refspec to integrate (pull origin feature); also see Self::fetch.

§explicit_fetch: bool

When true, integration uses FETCH_HEAD after fetch.

§autostash: bool

Stash dirty worktree/index changes around the integration (pull --autostash).

§check: bool

Fetch and report whether a fast-forward is possible without changing refs or the worktree.

§mode: Option<PullMode>

CLI override for integration mode; when None, resolve_pull_mode applies config.

§fetch: FetchOptions

Fetch options (tags, prune, depth, environment, …).

§upstream: Option<FetchedUpstream>

An upstream the caller already fetched: pull integrates it and fetches nothing.

Snapshot checkouts set this: they fetch the server’s snapshot themselves, from the URL the checkout records, and then bring the current branch onto it.

§stop_on_conflict: bool

Report a rebase that stops on a conflict as PullResult::RebaseStopped, with PullOutcome::oid at the branch’s pre-pull tip, instead of PullResult::RebaseConflicts. Both leave the same resumable rebase session; snapshot checkouts set this so their refresh can tell its own stop apart. Ignored when an autostash was made.

Implementations§

Source§

impl PullOptions

Source

pub fn for_working_branch( repo: &Repository, environment: Environment, cli_mode: Option<PullMode>, ) -> Result<Self, PullError>

Build pull options for the current branch from config and CLI mode flags.

§Errors

Returns PullError::DetachedHead or PullError::InvalidHead when HEAD is not on a branch.

Trait Implementations§

Source§

impl Clone for PullOptions

Source§

fn clone(&self) -> Self

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 Default for PullOptions

Source§

fn default() -> Self

Returns the “default value” for a type. 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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.