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

Method walk

atomic-cli/tests/it/git_adoption_cb7b_test.rs:279–294  ·  view source on GitHub ↗
(dir: &Path, base: &Path, out: &mut Vec<(String, Vec<u8>)>)

Source from the content-addressed store, hash-verified

277 return shelved;
278 }
279 fn walk(dir: &Path, base: &Path, out: &mut Vec<(String, Vec<u8>)>) {
280 for entry in fs::read_dir(dir).expect("walk shelf") {
281 let entry = entry.expect("entry");
282 let path = entry.path();
283 if path.is_dir() {
284 walk(&path, base, out);
285 } else {
286 let relative = path
287 .strip_prefix(base)
288 .expect("relative")
289 .to_string_lossy()
290 .into_owned();
291 out.push((relative, fs::read(&path).expect("shelf bytes")));
292 }
293 }
294 }
295 for entry in fs::read_dir(&workspaces).expect("walk workspaces") {
296 let dir = entry.expect("entry").path().join("workspaces");
297 if dir.is_dir() {

Callers 3

tree_holds_bytesFunction · 0.45
pathsMethod · 0.45

Calls 5

is_dirMethod · 0.80
walkFunction · 0.70
readFunction · 0.70
pathMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected