| 827 | } |
| 828 | |
| 829 | func TestOrphanedWorktreeNotTracked(t *testing.T) { |
| 830 | // An orphaned entry with no PRD loaded should still be cleanable |
| 831 | p := &PRDPicker{ |
| 832 | basePath: "/project", |
| 833 | entries: []PRDEntry{ |
| 834 | { |
| 835 | Name: "stale", |
| 836 | WorktreeDir: "/project/.chief/worktrees/stale", |
| 837 | Orphaned: true, |
| 838 | LoopState: loop.LoopStateReady, |
| 839 | LoadError: fmt.Errorf("orphaned worktree (no prd.json)"), |
| 840 | }, |
| 841 | }, |
| 842 | selectedIndex: 0, |
| 843 | } |
| 844 | if !p.CanClean() { |
| 845 | t.Error("expected CanClean() to return true for orphaned worktree without PRD") |
| 846 | } |
| 847 | } |
| 848 | |
| 849 | // --- Empty Directory Filtering Tests --- |
| 850 | |