WorktreePrune removes administrative files for worktrees that no longer exist on disk.
(ctx context.Context)
| 291 | // WorktreePrune removes administrative files for worktrees that no longer |
| 292 | // exist on disk. |
| 293 | func (c *Client) WorktreePrune(ctx context.Context) error { |
| 294 | cmd, err := c.Command(ctx, "worktree", "prune") |
| 295 | if err != nil { |
| 296 | return err |
| 297 | } |
| 298 | _, err = cmd.Output() |
| 299 | return err |
| 300 | } |
| 301 | |
| 302 | // parseWorktrees parses the output of `git worktree list --porcelain` into a |
| 303 | // slice of Worktree. Each record begins with a "worktree <path>" line followed |