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: boolWhen true, integration uses FETCH_HEAD after fetch.
autostash: boolStash dirty worktree/index changes around the integration (pull --autostash).
check: boolFetch 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: FetchOptionsFetch 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: boolReport 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
impl PullOptions
Sourcepub fn for_working_branch(
repo: &Repository,
environment: Environment,
cli_mode: Option<PullMode>,
) -> Result<Self, PullError>
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.