diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-08-02 08:12:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-02 08:12:44 +0200 |
commit | 9befb514d83e22268d00ab2c0fdd797b3742f0e9 (patch) | |
tree | 923a78009cce4531912b92e1b756a6a8f3ee6d32 /remote.go | |
parent | 91cdedae7faffca0a707fa47780efafe157ba47c (diff) | |
parent | e5c6fa237776870483cbe227d7f7ea943f35cb12 (diff) | |
download | go-git-9befb514d83e22268d00ab2c0fdd797b3742f0e9.tar.gz |
Merge pull request #501 from smola/config-multiple-urls
config: multiple values in RemoteConfig (URLs and Fetch)
Diffstat (limited to 'remote.go')
-rw-r--r-- | remote.go | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -43,8 +43,11 @@ func (r *Remote) Config() *config.RemoteConfig { } func (r *Remote) String() string { - fetch := r.c.URL - push := r.c.URL + var fetch, push string + if len(r.c.URLs) > 0 { + fetch = r.c.URLs[0] + push = r.c.URLs[0] + } return fmt.Sprintf("%s\t%s (fetch)\n%[1]s\t%[3]s (push)", r.c.Name, fetch, push) } @@ -71,7 +74,7 @@ func (r *Remote) PushContext(ctx context.Context, o *PushOptions) error { return fmt.Errorf("remote names don't match: %s != %s", o.RemoteName, r.c.Name) } - s, err := newSendPackSession(r.c.URL, o.Auth) + s, err := newSendPackSession(r.c.URLs[0], o.Auth) if err != nil { return err } @@ -211,7 +214,7 @@ func (r *Remote) fetch(ctx context.Context, o *FetchOptions) (storer.ReferenceSt o.RefSpecs = r.c.Fetch } - s, err := newUploadPackSession(r.c.URL, o.Auth) + s, err := newUploadPackSession(r.c.URLs[0], o.Auth) if err != nil { return nil, err } |