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

Method RemoteURL

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

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