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

Method RemoteURL

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

775
776// RemoteURL returns the fetch URL configured for the named remote.
777func (c *Client) RemoteURL(ctx context.Context, name string) (string, error) {
778 cmd, err := c.Command(ctx, "remote", "get-url", "--", name)
779 if err != nil {
780 return "", err
781 }
782 out, err := cmd.Output()
783 if err != nil {
784 return "", err
785 }
786 return firstLine(out), nil
787}
788
789// IsIgnored reports whether the given path is ignored by .gitignore rules.
790// Returns an error for fatal git failures (e.g. path outside repository).

Calls 3

CommandMethod · 0.95
firstLineFunction · 0.70
OutputMethod · 0.65