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

Method repos

backend/src/git/checks.rs:38–64  ·  view source on GitHub ↗
(&self, root: &PathBuf)

Source from the content-addressed store, hash-verified

36 }
37
38 fn repos(&self, root: &PathBuf) -> Result<Vec<RepoId>> {
39 let paths = fs::read_dir(root)?;
40
41 let mut repos = vec![];
42 for path in paths {
43 let path = path?.path();
44
45 let filename = match &path.file_name() {
46 Some(filename) => match filename.to_str() {
47 Some(filename) => filename,
48 None => {
49 log::error!("expected a filename: {:?}", path);
50 continue;
51 }
52 },
53 None => {
54 log::error!("expected a filename: {:?}", path);
55 continue;
56 }
57 };
58
59 let id = filename.to_string();
60 repos.push(RepoId::try_from(&id)?);
61 }
62
63 Ok(repos)
64 }
65}

Callers 1

callMethod · 0.45

Calls 1

pathMethod · 0.80

Tested by

no test coverage detected