MCPcopy
hub / github.com/cli/cli / HasLocalBranch

Method HasLocalBranch

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

Source from the content-addressed store, hash-verified

643}
644
645func (c *Client) HasLocalBranch(ctx context.Context, branch string) bool {
646 _, err := c.revParse(ctx, "--verify", "refs/heads/"+branch)
647 return err == nil
648}
649
650func (c *Client) TrackingBranchNames(ctx context.Context, prefix string) []string {
651 args := []string{"branch", "-r", "--format", "%(refname:strip=3)"}

Callers 1

TestClientHasLocalBranchFunction · 0.95

Calls 1

revParseMethod · 0.95

Tested by 1

TestClientHasLocalBranchFunction · 0.76