pub struct CloneOptions {Show 17 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 auto_filter: bool,
pub config: Vec<(String, String)>,
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,
pub bundle_cache: Option<PathBuf>,
}Expand description
Options for clone.
Fields§
§url: StringSource URL or path (as passed on the command line).
dest: PathBufDirectory to create or use for the new repository.
remote_name: StringRemote name to configure (default DEFAULT_REMOTE).
environment: EnvironmentProcess environment for config and reflog identity.
initial_branch: StringInitial branch name used when initializing the empty repo (main).
thread_policy: ThreadPolicyGlobal 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.
auto_filter: boolPick the filter from the promisor remotes the server advertises and the new
repository accepts (Git’s clone --filter=auto), and record
remote.<name>.partialclonefilter=auto so later fetches do the same. Ignored when
Self::filter is set. Accepting needs promisor.acceptFromServer and the promisor
remotes themselves in config, usually through Self::config.
config: Vec<(String, String)>Config entries written into the new repository right after it is created, before
anything is fetched (git clone -c <key>=<value>). Each entry is added, so a key
given twice gets both values.
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.
Tag fetch mode. None uses Git defaults: all tags for full multi-branch clones,
tag-following when clone_effective_single_branch is true (explicit
--single-branch or shallow clone without --no-single-branch).
promisor_fetcher: Option<Arc<dyn PromisorFetcher>>Optional on-demand promisor fetcher installed on the opened repository (for checkout prefetch).
bare: boolCreate a bare repository (git clone --bare).
checkout: boolPopulate the index and working tree after fetch (git clone --no-checkout when false).
bundle_cache: Option<PathBuf>Where bundle downloads are kept, so an interrupted clone resumes its
download next time. None skips the server’s bundle-uri bundle. Shallow
and partial clones never use one.