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

Function print_forensic_status

atomic-cli/src/commands/status.rs:867–908  ·  view source on GitHub ↗
(
    repo_root: &Path,
    repo: &Repository,
    view: &str,
    remediation: Option<&WorkspaceRemediation>,
)

Source from the content-addressed store, hash-verified

865}
866
867fn print_forensic_status(
868 repo_root: &Path,
869 repo: &Repository,
870 view: &str,
871 remediation: Option<&WorkspaceRemediation>,
872) -> CliResult<()> {
873 let atomic = AtomicAnchorObservation {
874 state: repo
875 .get_view_info(view)
876 .map_err(CliError::from)?
877 .state
878 .to_string(),
879 view: view.to_string(),
880 };
881 let checkpoint = read_checkpoint_observation(repo_root)?;
882 let git = observe_git(repo_root).map_err(|error| CliError::GitError {
883 message: error.to_string(),
884 })?;
885 let eligibility = classify_provisional_checkpoint(
886 &git,
887 &atomic,
888 checkpoint.as_ref(),
889 &ManifestEquivalence::NotComputed,
890 );
891 let manifest_root = forensic_manifest_root(repo_root, repo, view);
892
893 print!(
894 "{}",
895 build_forensic_report(
896 repo_root,
897 &atomic,
898 checkpoint.as_ref(),
899 &git,
900 &eligibility,
901 manifest_root.as_deref(),
902 )
903 );
904 if let Some(remediation) = remediation {
905 println!("Workspace remediation required: {remediation:#?}");
906 }
907 Ok(())
908}
909
910fn forensic_manifest_root(repo_root: &Path, repo: &Repository, view: &str) -> Option<String> {
911 if !repo_root.join(".git").exists() {

Callers 1

runMethod · 0.85

Calls 6

observe_gitFunction · 0.85
forensic_manifest_rootFunction · 0.85
get_view_infoMethod · 0.80
as_refMethod · 0.80

Tested by

no test coverage detected