Skip to main content

CloneOptions

Struct CloneOptions 

Source
pub struct CloneOptions {
Show 14 fields pub url: String, pub dest: PathBuf, pub remote_name: String, pub environment: Environment, pub initial_branch: String, pub thread_policy: ThreadPolicy, pub depth: Option<u32>, pub filter: Option<ObjectFilterSpec>, pub branch: Option<String>, pub single_branch: Option<bool>, pub tags: Option<CloneTags>, pub promisor_fetcher: Option<Arc<dyn PromisorFetcher>>, pub bare: bool, pub checkout: bool,
}
Expand description

Options for clone.

Fields§

§url: String

Source URL or path (as passed on the command line).

§dest: PathBuf

Directory to create or use for the new repository.

§remote_name: String

Remote name to configure (default DEFAULT_REMOTE).

§environment: Environment

Process environment for config and reflog identity.

§initial_branch: String

Initial branch name used when initializing the empty repo (main).

§thread_policy: ThreadPolicy

Global thread policy for fetch pack ingest and the opened repository (--threads).

§depth: Option<u32>

Truncate fetched history to this many commits per ref tip (git clone --depth N). Some(1) matches a shallow clone.

§filter: Option<ObjectFilterSpec>

Partial-clone object filter applied to the initial fetch and recorded in config.

§branch: Option<String>

Remote branch or tag to check out (git clone -b / --branch).

§single_branch: Option<bool>

Single-branch fetch (git clone --single-branch / --no-single-branch).

None matches Git: depth implies single-branch unless explicitly disabled.

§tags: Option<CloneTags>

Tag fetch mode. None uses Git defaults (all tags for full clones, following for shallow).

§promisor_fetcher: Option<Arc<dyn PromisorFetcher>>

Optional on-demand promisor fetcher installed on the opened repository (for checkout prefetch).

§bare: bool

Create a bare repository (git clone --bare).

§checkout: bool

Populate the index and working tree after fetch (git clone --no-checkout when false).

Implementations§

Source§

impl CloneOptions

Source

pub fn new(url: impl Into<String>, dest: PathBuf) -> Self

Options for cloning into dest from url, using the current process environment.

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> 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, 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.