RemoteURL returns the fetch URL configured for the named remote.
(ctx context.Context, name string)
| 715 | |
| 716 | // RemoteURL returns the fetch URL configured for the named remote. |
| 717 | func (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). |