MCPcopy Index your code
hub / github.com/AI45Lab/Code / walkdir

Function walkdir

core/src/git.rs:378–391  ·  view source on GitHub ↗

Walk directory recursively (simple implementation).

(dir: &Path)

Source from the content-addressed store, hash-verified

376
377/// Walk directory recursively (simple implementation).
378fn walkdir(dir: &Path) -> Vec<std::path::PathBuf> {
379 let mut files = Vec::new();
380 if let Ok(entries) = std::fs::read_dir(dir) {
381 for entry in entries.filter_map(|e| e.ok()) {
382 let path = entry.path();
383 if path.is_dir() {
384 files.extend(walkdir(&path));
385 } else {
386 files.push(path);
387 }
388 }
389 }
390 files
391}
392
393/// Run a git command.
394fn run_git(repo_path: &Path, args: &[&str]) -> Result<(bool, String, String)> {

Callers 1

install_git_linuxFunction · 0.85

Calls 1

pathMethod · 0.80

Tested by

no test coverage detected