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

Function verify_with

atomic-cli/src/commands/git/shim.rs:2707–2733  ·  view source on GitHub ↗
(
    repo: &Repository,
    working_copy: WorkingCopyId,
    git: &GitRepository,
)

Source from the content-addressed store, hash-verified

2705/// are exclusive, so callers holding a writable handle must reuse it).
2706#[tracing::instrument(name = "verify", skip_all)]
2707pub(crate) fn verify_with(
2708 repo: &Repository,
2709 working_copy: WorkingCopyId,
2710 git: &GitRepository,
2711) -> CliResult<ShimSnapshot> {
2712 let (branch, head, tree) = workspace_head_aligned(repo, working_copy, git)?;
2713 require_clean_git_worktree(git)?;
2714 let atomic_status = repo
2715 .status(working_copy, StatusOptions::default())
2716 .map_err(CliError::from)?;
2717 if !atomic_status.is_clean() {
2718 return Err(git_error("Atomic working copy is not clean"));
2719 }
2720 verify_complete_equivalence(repo, &branch, repo.root(), git, "Git shim verification")?;
2721 let atomic_state = repo
2722 .get_view_info(&branch)
2723 .map_err(CliError::from)?
2724 .state
2725 .to_string();
2726
2727 Ok(ShimSnapshot {
2728 view: branch,
2729 atomic_state,
2730 git_head: head.to_string(),
2731 git_tree: tree.to_string(),
2732 })
2733}
2734
2735/// Resolve the (view, HEAD commit, HEAD tree) triple for the workspace with
2736/// the §7.5/CB-8A detached alignment rule: an attached HEAD must name the

Callers 1

switch_transactionFunction · 0.85

Calls 8

workspace_head_alignedFunction · 0.85
get_view_infoMethod · 0.80
git_errorFunction · 0.70
statusMethod · 0.45
is_cleanMethod · 0.45
rootMethod · 0.45

Tested by

no test coverage detected