WorktreeRemove removes the worktree at the given path via `git worktree remove `.
(ctx context.Context, path string)
| 280 | // WorktreeRemove removes the worktree at the given path via |
| 281 | // `git worktree remove <path>`. |
| 282 | func (c *Client) WorktreeRemove(ctx context.Context, path string) error { |
| 283 | cmd, err := c.Command(ctx, "worktree", "remove", "--", path) |
| 284 | if err != nil { |
| 285 | return err |
| 286 | } |
| 287 | _, err = cmd.Output() |
| 288 | return err |
| 289 | } |
| 290 | |
| 291 | // WorktreePrune removes administrative files for worktrees that no longer |
| 292 | // exist on disk. |