namespace ClaudeDo.Ui.Services; public sealed record RepoCandidate(string Name, string FullPath); public static class RepoScanner { public static IReadOnlyList Scan(string parentFolder) { if (string.IsNullOrWhiteSpace(parentFolder) || !Directory.Exists(parentFolder)) return Array.Empty(); var result = new List(); IEnumerable subdirs; try { subdirs = Directory.EnumerateDirectories(parentFolder); } catch (Exception e) when (e is IOException or UnauthorizedAccessException) { return Array.Empty(); } foreach (var dir in subdirs) { var gitPath = Path.Combine(dir, ".git"); if (Directory.Exists(gitPath) || File.Exists(gitPath)) result.Add(new RepoCandidate(Path.GetFileName(dir), dir)); } return result; } }