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