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