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