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

Function changed_paths

libatomic/src/review/view_comparison/impact.rs:9–39  ·  view source on GitHub ↗
(comparison: &ViewComparison)

Source from the content-addressed store, hash-verified

7use super::ViewComparison;
8
9pub(in super::super) fn changed_paths(comparison: &ViewComparison) -> Vec<String> {
10 if comparison.before.state == comparison.after.state
11 && comparison.before.membership_hash == comparison.after.membership_hash
12 {
13 return vec![];
14 }
15 let recorded_changes: BTreeSet<_> = comparison
16 .conformance
17 .changes
18 .iter()
19 .flat_map(|change| change.paths.iter())
20 .collect();
21 comparison
22 .files
23 .iter()
24 .filter(|file| {
25 file.status != "unchanged"
26 && (file.status != "unavailable"
27 || file
28 .before_path
29 .iter()
30 .chain(&file.after_path)
31 .any(|path| recorded_changes.contains(path)))
32 })
33 .flat_map(|file| file.before_path.iter().chain(&file.after_path))
34 .filter(|path| !atomic_repository::is_vault_path(path))
35 .cloned()
36 .collect::<BTreeSet<_>>()
37 .into_iter()
38 .collect()
39}
40
41pub(in super::super) fn inspect(
42 repo: &Repository,

Callers 2

inspectFunction · 0.70
buildFunction · 0.50

Calls 5

is_vault_pathFunction · 0.50
collectMethod · 0.45
iterMethod · 0.45
into_iterMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected