Worktrees lists the repository's worktrees by parsing the output of `git worktree list --porcelain`.
(ctx context.Context)
| 266 | // Worktrees lists the repository's worktrees by parsing the output of |
| 267 | // `git worktree list --porcelain`. |
| 268 | func (c *Client) Worktrees(ctx context.Context) ([]Worktree, error) { |
| 269 | cmd, err := c.Command(ctx, "worktree", "list", "--porcelain") |
| 270 | if err != nil { |
| 271 | return nil, err |
| 272 | } |
| 273 | out, err := cmd.Output() |
| 274 | if err != nil { |
| 275 | return nil, err |
| 276 | } |
| 277 | return parseWorktrees(out), nil |
| 278 | } |
| 279 | |
| 280 | // WorktreeRemove removes the worktree at the given path via |
| 281 | // `git worktree remove <path>`. |
nothing calls this directly
no test coverage detected