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

Function change_coverage_class

atomic-cli/src/commands/git/census.rs:54–90  ·  view source on GitHub ↗

Every change in the desired view's effective history loads from the change store.

(repo: &Repository, view_name: &str)

Source from the content-addressed store, hash-verified

52/// Every change in the desired view's effective history loads from the
53/// change store.
54fn change_coverage_class(repo: &Repository, view_name: &str) -> CensusClass {
55 let name = "census/changes";
56 match repo.effective_history(Some(view_name)) {
57 Ok(entries) => {
58 let total = entries.len();
59 let mut missing: Vec<String> = Vec::new();
60 for entry in &entries {
61 if repo.load_change(&entry.hash).is_err() {
62 missing.push(entry.hash.to_base32());
63 }
64 }
65 if missing.is_empty() {
66 CensusClass {
67 name,
68 clean: true,
69 detail: format!("{total} recorded change(s) all load"),
70 }
71 } else {
72 CensusClass {
73 name,
74 clean: false,
75 detail: format!(
76 "{}/{} recorded change(s) FAIL to load: {}",
77 missing.len(),
78 total,
79 missing.join(", ")
80 ),
81 }
82 }
83 }
84 Err(error) => CensusClass {
85 name,
86 clean: false,
87 detail: format!("cannot enumerate the view history: {error}"),
88 },
89 }
90}
91
92/// Every stored binding loads and passes its cryptographic verification
93/// (payload validity + signature).

Callers

nothing calls this directly

Calls 6

effective_historyMethod · 0.80
lenMethod · 0.45
load_changeMethod · 0.45
pushMethod · 0.45
to_base32Method · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected