diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2024-08-27 12:02:32 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-09-02 18:18:12 +0200 |
commit | 8c1e320dd40c8f99df46bdf0f1097d2365485519 (patch) | |
tree | a02ced29f8b3c5497733f75d0c040d62746ef5f1 /remote.go | |
parent | 5c762aefcd8dded79e25bc2055254b4146e2b5a9 (diff) | |
download | go-git-8c1e320dd40c8f99df46bdf0f1097d2365485519.tar.gz |
This is a hack: we should collect pull URLs and push URLs (if
any) separately and use the appropriate ones, or perhaps add a
flag to each URL, whether it is capable of pushing.
Also, add test for the remote URLs (pull and push)
Diffstat (limited to 'remote.go')
-rw-r--r-- | remote.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -83,7 +83,7 @@ func (r *Remote) String() string { var fetch, push string if len(r.c.URLs) > 0 { fetch = r.c.URLs[0] - push = r.c.URLs[0] + push = r.c.URLs[len(r.c.URLs) - 1] } return fmt.Sprintf("%s\t%s (fetch)\n%[1]s\t%[3]s (push)", r.c.Name, fetch, push) @@ -111,7 +111,7 @@ func (r *Remote) PushContext(ctx context.Context, o *PushOptions) (err error) { } if o.RemoteURL == "" { - o.RemoteURL = r.c.URLs[0] + o.RemoteURL = r.c.URLs[len(r.c.URLs) - 1] } s, err := newSendPackSession(o.RemoteURL, o.Auth, o.InsecureSkipTLS, o.CABundle, o.ProxyOptions) |