use crate::config::Config;
pub fn outside(cfg: &Config) -> impl Fn(&ignore::DirEntry) -> bool + Send + Sync + 'static {
let root = cfg.root.clone();
let owners = cfg.raw.owners.clone();
move |e| {
let rel = e.path().strip_prefix(&root).map(|p| p.to_string_lossy().replace('\\', "/"));
rel.is_err() || rel.is_ok_and(|r| r.is_empty() || !owners.in_nested(&r))
}
}
pub fn remotes(root: &std::path::Path, owners: &crate::config::types::OwnersSection) -> Vec<(String, String)> {
owners
.nested_dirs()
.filter(|p| root.join(p).join(crate::config::defaults::CONFIG_FILE).is_file())
.map(|p| (p.rsplit('/').next().unwrap_or(p).to_string(), p.to_string()))
.collect()
}