MCPcopy
hub / github.com/cli/cli / RemoteURL

Method RemoteURL

git/client.go:717–727  ·  view source on GitHub ↗

RemoteURL returns the fetch URL configured for the named remote.

(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

715
716// RemoteURL returns the fetch URL configured for the named remote.
717func (c *Client) RemoteURL(ctx context.Context, name string) (string, error) {
718 cmd, err := c.Command(ctx, "remote", "get-url", "--", name)
719 if err != nil {
720 return "", err
721 }
722 out, err := cmd.Output()
723 if err != nil {
724 return "", err
725 }
726 return firstLine(out), nil
727}
728
729// IsIgnored reports whether the given path is ignored by .gitignore rules.
730// Returns an error for fatal git failures (e.g. path outside repository).

Callers 3

TestClientRemoteURLFunction · 0.95
detectGitHubRemoteFunction · 0.80

Calls 3

CommandMethod · 0.95
firstLineFunction · 0.85
OutputMethod · 0.65

Tested by 1

TestClientRemoteURLFunction · 0.76