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

Method RemoteURL

git/client.go:779–789  ·  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

777
778// RemoteURL returns the fetch URL configured for the named remote.
779func (c *Client) RemoteURL(ctx context.Context, name string) (string, error) {
780 cmd, err := c.Command(ctx, "remote", "get-url", "--", name)
781 if err != nil {
782 return "", err
783 }
784 out, err := cmd.Output()
785 if err != nil {
786 return "", err
787 }
788 return firstLine(out), nil
789}
790
791// IsIgnored reports whether the given path is ignored by .gitignore rules.
792// 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