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

Method DeleteLocalBranch

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

Source from the content-addressed store, hash-verified

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

Callers 3

closeRunFunction · 0.80
deleteLocalBranchMethod · 0.80

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65

Tested by 1