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