MCPcopy Create free account
hub / github.com/cli/cli / WorktreePrune

Method WorktreePrune

git/client.go:287–294  ·  view source on GitHub ↗

WorktreePrune removes administrative files for worktrees that no longer exist on disk.

(ctx context.Context)

Source from the content-addressed store, hash-verified

285// WorktreePrune removes administrative files for worktrees that no longer
286// exist on disk.
287func (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

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65