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

Method WorktreePrune

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

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

Callers 2

TestClientWorktreePruneFunction · 0.95
deleteLocalBranchMethod · 0.80

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65

Tested by 1

TestClientWorktreePruneFunction · 0.76