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

Method DeleteLocalBranch

git/client.go:668–679  ·  view source on GitHub ↗
(ctx context.Context, branch string)

Source from the content-addressed store, hash-verified

666}
667
668func (c *Client) DeleteLocalBranch(ctx context.Context, branch string) error {
669 args := []string{"branch", "-D", branch}
670 cmd, err := c.Command(ctx, args...)
671 if err != nil {
672 return err
673 }
674 _, err = cmd.Output()
675 if err != nil {
676 return err
677 }
678 return nil
679}
680
681func (c *Client) CheckoutBranch(ctx context.Context, branch string) error {
682 args := []string{"checkout", branch}

Callers 3

closeRunFunction · 0.80
deleteLocalBranchMethod · 0.80

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65

Tested by 1