MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / git_clone

Function git_clone

atomic-cli/src/commands/git/bootstrap.rs:89–103  ·  view source on GitHub ↗

Run `git clone ` with inherited stdio (the user's auth config, agents, and askpass prompts behave exactly like plain Git).

(url: &str, target: &Path)

Source from the content-addressed store, hash-verified

87/// Run `git clone <url> <path>` with inherited stdio (the user's auth
88/// config, agents, and askpass prompts behave exactly like plain Git).
89pub(crate) fn git_clone(url: &str, target: &Path) -> CliResult<()> {
90 let status = Command::new("git")
91 .args(["clone", url])
92 .arg(target)
93 .status()
94 .map_err(|error| CliError::GitError {
95 message: format!("cannot run git clone: {error}"),
96 })?;
97 if !status.success() {
98 return Err(CliError::GitError {
99 message: format!("git clone of '{url}' exited with {status}"),
100 });
101 }
102 Ok(())
103}
104
105/// Fetch the RFC §8.6 binding/view namespaces from `remote` after the
106/// refspecs are configured. Plain `git clone` transfers only

Callers 1

run_git_bootstrapMethod · 0.85

Calls 2

successMethod · 0.80
statusMethod · 0.45

Tested by

no test coverage detected