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

Method WorktreePrune

git/client.go:294–301  ·  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

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

Callers 2

TestClientWorktreePruneFunction · 0.95
deleteLocalBranchMethod · 0.80

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65

Tested by 1

TestClientWorktreePruneFunction · 0.76