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