MCPcopy Create free account
hub / github.com/emwalker/digraph / call

Method call

backend/src/git/checks.rs:13–36  ·  view source on GitHub ↗
(&self, client: &Client)

Source from the content-addressed store, hash-verified

11
12impl LeakedData {
13 pub fn call(&self, client: &Client) -> Result<Vec<(RepoId, String)>> {
14 let root = client.root.path.to_owned();
15 let repos = self.repos(&root)?;
16 env::set_current_dir(&root)?;
17
18 let mut leaks = vec![];
19 for repo in repos {
20 let output = Command::new("grep")
21 .arg("-rl")
22 .arg(repo.to_string())
23 .arg(".")
24 .output()?;
25 let pat = format!(".{repo}");
26
27 let result = String::from_utf8(output.stdout)?;
28 for line in result.lines() {
29 if !line.starts_with(&pat) {
30 leaks.push((repo.to_owned(), line.to_owned()));
31 }
32 }
33 }
34
35 Ok(leaks)
36 }
37
38 fn repos(&self, root: &PathBuf) -> Result<Vec<RepoId>> {
39 let paths = fs::read_dir(root)?;

Callers

nothing calls this directly

Calls 2

starts_withMethod · 0.80
reposMethod · 0.45

Tested by

no test coverage detected