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

Function localBranchExists

pkg/cmd/pr/checkout/checkout.go:326–329  ·  view source on GitHub ↗
(client *git.Client, b string)

Source from the content-addressed store, hash-verified

324}
325
326func localBranchExists(client *git.Client, b string) bool {
327 _, err := client.ShowRefs(context.Background(), []string{"refs/heads/" + b})
328 return err == nil
329}
330
331// resolveWorktreeTarget asks git where path lives, letting git resolve symlinks,
332// "..", case, and trailing slashes for us instead of comparing paths ourselves.

Callers 2

cmdsForExistingRemoteFunction · 0.85
cmdsForMissingRemoteFunction · 0.85

Calls 1

ShowRefsMethod · 0.80

Tested by

no test coverage detected