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

Method HasLocalBranch

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

Source from the content-addressed store, hash-verified

705}
706
707func (c *Client) HasLocalBranch(ctx context.Context, branch string) bool {
708 _, err := c.revParse(ctx, "--verify", "refs/heads/"+branch)
709 return err == nil
710}
711
712func (c *Client) TrackingBranchNames(ctx context.Context, prefix string) []string {
713 args := []string{"branch", "-r", "--format", "%(refname:strip=3)"}

Callers 1

TestClientHasLocalBranchFunction · 0.95

Calls 1

revParseMethod · 0.95

Tested by 1

TestClientHasLocalBranchFunction · 0.76