Deduplicate repos in discovery #813

This commit is contained in:
Alex Netsch
2025-09-23 12:03:18 +01:00
committed by GitHub
parent 56655dffca
commit a8bee8da52

View File

@@ -215,10 +215,15 @@ impl FilesystemService {
for p in path.iter().skip(1) {
walker_builder.add(p);
}
let mut seen_dirs = HashSet::new();
let mut git_repos: Vec<DirectoryEntry> = walker_builder
.build()
.filter_map(|entry| {
let entry = entry.ok()?;
if seen_dirs.contains(entry.path()) {
return None;
}
seen_dirs.insert(entry.path().to_owned());
let name = entry.file_name().to_str()?;
if !entry.path().join(".git").exists() {
return None;