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

Method TrackingBranchNames

git/client.go:650–664  ·  view source on GitHub ↗
(ctx context.Context, prefix string)

Source from the content-addressed store, hash-verified

648}
649
650func (c *Client) TrackingBranchNames(ctx context.Context, prefix string) []string {
651 args := []string{"branch", "-r", "--format", "%(refname:strip=3)"}
652 if prefix != "" {
653 args = append(args, "--list", fmt.Sprintf("*/%s*", escapeGlob(prefix)))
654 }
655 cmd, err := c.Command(ctx, args...)
656 if err != nil {
657 return nil
658 }
659 output, err := cmd.Output()
660 if err != nil {
661 return nil
662 }
663 return strings.Split(string(output), "\n")
664}
665
666// ToplevelDir returns the top-level directory path of the current repository.
667func (c *Client) ToplevelDir(ctx context.Context) (string, error) {

Callers

nothing calls this directly

Calls 3

CommandMethod · 0.95
escapeGlobFunction · 0.85
OutputMethod · 0.65

Tested by

no test coverage detected