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

Method WorktreeRemove

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

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