Mark untracked directories that are git repositories

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 20:12:13 +02:00
co-authored by Claude Sonnet 5.5
parent 69d0f9b704
commit af6d03a5b1
7 changed files with 45 additions and 3 deletions
+19
View File
@@ -50,3 +50,22 @@ func TestHiddenIssues(t *testing.T) {
t.Errorf("HiddenIssues() = %d, %v; want 2, LevelDanger", count, worst)
}
}
func TestUntrackedRepositoryWording(t *testing.T) {
repo := FileChange{Path: "lib/x/", Kind: ChangeUntracked, Repo: true}
file := FileChange{Path: "a.txt", Kind: ChangeUntracked}
for _, c := range []struct {
files []FileChange
want string
}{
{[]FileChange{repo}, "untracked repository"},
{[]FileChange{repo, file}, "untracked files"},
{[]FileChange{file}, "untracked files"},
} {
s := &Status{Worktree: WorktreeUntracked, Changes: &Changes{Total: len(c.files), Files: c.files}}
got := s.Issues()
if len(got) == 0 || got[len(got)-1].Detail != c.want {
t.Errorf("%v: got %v, want %q", c.files, got, c.want)
}
}
}