(
repo_root: &Path,
repo: &Repository,
view: &str,
remediation: Option<&WorkspaceRemediation>,
)
| 865 | } |
| 866 | |
| 867 | fn 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 | |
| 910 | fn forensic_manifest_root(repo_root: &Path, repo: &Repository, view: &str) -> Option<String> { |
| 911 | if !repo_root.join(".git").exists() { |
no test coverage detected