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

Method WorktreeRemove

git/client.go:282–289  ·  view source on GitHub ↗

WorktreeRemove removes the worktree at the given path via `git worktree remove `.

(ctx context.Context, path string)

Source from the content-addressed store, hash-verified

280// WorktreeRemove removes the worktree at the given path via
281// `git worktree remove <path>`.
282func (c *Client) WorktreeRemove(ctx context.Context, path string) error {
283 cmd, err := c.Command(ctx, "worktree", "remove", "--", path)
284 if err != nil {
285 return err
286 }
287 _, err = cmd.Output()
288 return err
289}
290
291// WorktreePrune removes administrative files for worktrees that no longer
292// exist on disk.

Callers 2

TestClientWorktreeRemoveFunction · 0.95
deleteLocalBranchMethod · 0.80

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65

Tested by 1

TestClientWorktreeRemoveFunction · 0.76