fix(ui): stop treating git worktrees and submodules as repos

.git as a file (worktrees, submodules) isn't a standalone repo — the
scanner was flooding the import list with worktree entries alongside
their real repo.
This commit is contained in:
mika kuns
2026-09-02 09:59:12 +02:00
parent 30d0611b8e
commit b6e5876b07
2 changed files with 9 additions and 9 deletions
+6 -4
View File
@@ -35,15 +35,17 @@ public sealed class RepoScannerTests : IDisposable
}
[Fact]
public void Scan_TreatsDotGitFileAsRepo()
public void Scan_IgnoresWorktrees()
{
var repo = MakeDir("worktree-repo");
File.WriteAllText(Path.Combine(repo, ".git"), "gitdir: ../somewhere");
var repo = MakeDir("repo-a");
Directory.CreateDirectory(Path.Combine(repo, ".git"));
var worktree = MakeDir("repo-a-my-task");
File.WriteAllText(Path.Combine(worktree, ".git"), "gitdir: ../repo-a/.git/worktrees/my-task");
var result = RepoScanner.Scan(_root);
Assert.Single(result);
Assert.Equal("worktree-repo", result[0].Name);
Assert.Equal("repo-a", result[0].Name);
}
[Fact]