use std::path::{Path, PathBuf};
use walkdir::WalkDir;
pub fn find_repos(base: &Path, max_depth: usize) -> Vec<PathBuf> {
WalkDir::new(base)
.max_depth(max_depth)
.follow_links(false)
.into_iter()
.filter_map(|entry| entry.ok()) .filter(|entry| entry.file_name() == ".git" && entry.file_type().is_dir())
.filter_map(|entry| entry.path().parent().map(Path::to_path_buf)) .collect()
}
pub fn display_name(repo: &Path) -> String {
repo.canonicalize()
.ok()
.and_then(|p| p.file_name().map(|n| n.to_string_lossy().into_owned()))
.unwrap_or_else(|| repo.to_string_lossy().into_owned())
}