#[non_exhaustive]pub struct CloneSpec {
pub branch: Option<String>,
pub depth: Option<u32>,
pub filter: Option<CloneFilter>,
pub single_branch: bool,
pub origin: Option<String>,
pub bare: bool,
}Expand description
Options for GitApi::clone_repo (git clone).
#[non_exhaustive], so build it through CloneSpec::new and the chained
setters rather than a struct literal.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.branch: Option<String>Check out this branch instead of the remote’s default (--branch).
depth: Option<u32>Shallow-clone to this many commits (--depth). git silently ignores
the flag for a plain local-path source (warns, still clones fully);
use a file:// URL to shallow-clone locally.
filter: Option<CloneFilter>Use a partial-clone object filter (--filter=blob:none or
--filter=tree:0).
single_branch: boolLimit the clone to the selected branch (--single-branch).
origin: Option<String>Name the remote created by the clone instead of origin (--origin).
The value is checked before spawning git.
bare: boolCreate a bare repository (--bare).
Implementations§
Source§impl CloneSpec
impl CloneSpec
Sourcepub fn branch(self, branch: impl Into<String>) -> Self
pub fn branch(self, branch: impl Into<String>) -> Self
Check out branch instead of the remote’s default (--branch).
Sourcepub fn depth(self, depth: u32) -> Self
pub fn depth(self, depth: u32) -> Self
Shallow-clone to depth commits (--depth); see the field doc for the
local-path caveat.
Sourcepub fn filter(self, filter: CloneFilter) -> Self
pub fn filter(self, filter: CloneFilter) -> Self
Use a partial clone filter (--filter=<value>).
Sourcepub fn single_branch(self) -> Self
pub fn single_branch(self) -> Self
Restrict the clone to the selected branch (--single-branch).