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