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

Function clone_git_url

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

`atomic clone `: initialize Atomic inside an already-cloned checkout and run the shared binding-first bootstrap in it. The scaffold is repository-level only (no `.atomicignore` recording): the cloned worktree must stay byte-identical to the bound Git tree so the pre-adoption projection proof compares like with like. Local ignore configuration is an ordinary post-bootstrap untracked path.

(
    target: &Path,
    view_name: &str,
    key_file: Option<&Path>,
    include_degraded: bool,
)

Source from the content-addressed store, hash-verified

576/// pre-adoption projection proof compares like with like. Local ignore
577/// configuration is an ordinary post-bootstrap untracked path.
578pub(crate) fn clone_git_url(
579 target: &Path,
580 view_name: &str,
581 key_file: Option<&Path>,
582 include_degraded: bool,
583) -> CliResult<BootstrapOutcome> {
584 let mut repo = Repository::init(target).map_err(CliError::Repository)?;
585 let working_copy = repo
586 .require_working_copy_id()
587 .map_err(CliError::Repository)?;
588 if view_name != atomic_repository::DEFAULT_VIEW {
589 repo.create_view(view_name).map_err(CliError::Repository)?;
590 repo.align_to_view(working_copy, view_name)
591 .map_err(CliError::Repository)?;
592 }
593 drop(repo);
594 adopt_git_checkout(target, key_file, "origin", include_degraded)
595}
596
597/// Lowercase hex encoding for error messages.
598fn hex_encode(bytes: &[u8]) -> String {

Callers 1

run_git_bootstrapMethod · 0.85

Calls 5

adopt_git_checkoutFunction · 0.85
initFunction · 0.50
create_viewMethod · 0.45
align_to_viewMethod · 0.45

Tested by

no test coverage detected