( repo: string, keep: Set<string> = new Set(), )
| 166 | throw err; |
| 167 | } |
| 168 | return attached; |
| 169 | } |
| 170 | |
| 171 | export async function listWorktrees(repo: string): Promise<Worktree[]> { |
| 172 | const { stdout } = await execFile('git', ['-C', repo, 'worktree', 'list', '--porcelain']); |
| 173 | const trees: Worktree[] = []; |
| 174 | let cur: Partial<Worktree> = {}; |
| 175 | const push = () => { |
| 176 | if (!cur.path) return; |
| 177 | const branch = cur.branch ?? '(detached)'; |
| 178 | trees.push({ |
| 179 | path: cur.path, |
| 180 | branch, |
no test coverage detected