MCPcopy Index your code
hub / github.com/cli/cli / DeleteLocalBranch

Method DeleteLocalBranch

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

Source from the content-addressed store, hash-verified

603}
604
605func (c *Client) DeleteLocalBranch(ctx context.Context, branch string) error {
606 args := []string{"branch", "-D", branch}
607 cmd, err := c.Command(ctx, args...)
608 if err != nil {
609 return err
610 }
611 _, err = cmd.Output()
612 if err != nil {
613 return err
614 }
615 return nil
616}
617
618func (c *Client) CheckoutBranch(ctx context.Context, branch string) error {
619 args := []string{"checkout", branch}

Callers 3

closeRunFunction · 0.80
deleteLocalBranchMethod · 0.80

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65

Tested by 1