(
repo: &Repository,
working_copy: WorkingCopyId,
git: &GitRepository,
)
| 2705 | /// are exclusive, so callers holding a writable handle must reuse it). |
| 2706 | #[tracing::instrument(name = "verify", skip_all)] |
| 2707 | pub(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 |
no test coverage detected