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

Function verify_with

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

Source from the content-addressed store, hash-verified

2661/// are exclusive, so callers holding a writable handle must reuse it).
2662#[tracing::instrument(name = "verify", skip_all)]
2663pub(crate) fn verify_with(
2664 repo: &Repository,
2665 working_copy: WorkingCopyId,
2666 git: &GitRepository,
2667) -> CliResult<ShimSnapshot> {
2668 let (branch, head, tree) = workspace_head_aligned(repo, working_copy, git)?;
2669 require_clean_git_worktree(git)?;
2670 let atomic_status = repo
2671 .status(working_copy, StatusOptions::default())
2672 .map_err(CliError::from)?;
2673 if !atomic_status.is_clean() {
2674 return Err(git_error("Atomic working copy is not clean"));
2675 }
2676 verify_complete_equivalence(repo, &branch, repo.root(), git, "Git shim verification")?;
2677 let atomic_state = repo
2678 .get_view_info(&branch)
2679 .map_err(CliError::from)?
2680 .state
2681 .to_string();
2682
2683 Ok(ShimSnapshot {
2684 view: branch,
2685 atomic_state,
2686 git_head: head.to_string(),
2687 git_tree: tree.to_string(),
2688 })
2689}
2690
2691/// Resolve the (view, HEAD commit, HEAD tree) triple for the workspace with
2692/// 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