diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-21 01:07:15 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-21 01:07:15 +0200 |
commit | b32e92d013f6fe0d97f094c4b1991100d568f980 (patch) | |
tree | c80e847e3409fe0303a3ebabdf3e2a01c45b37f3 /remote.go | |
parent | c9f0c29f423f9bb26f32d6e8c7098f275171afb9 (diff) | |
download | go-git-b32e92d013f6fe0d97f094c4b1991100d568f980.tar.gz |
remote and repository base on ConfigStore
Diffstat (limited to 'remote.go')
-rw-r--r-- | remote.go | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -12,17 +12,16 @@ import ( // Remote represents a connection to a remote repository type Remote struct { - Config *config.RemoteConfig - + c *config.RemoteConfig s Storage + // cache fields, there during the connection is open upSrv common.GitUploadPackService upInfo *common.GitUploadPackInfo } -// NewRemote returns a new Remote, using as client http.DefaultClient -func NewRemote(s Storage, c *config.RemoteConfig) *Remote { - return &Remote{Config: c, s: s} +func newRemote(s Storage, c *config.RemoteConfig) *Remote { + return &Remote{s: s, c: c} } // Connect with the endpoint @@ -35,7 +34,7 @@ func (r *Remote) Connect() error { } func (r *Remote) connectUploadPackService() error { - endpoint, err := common.NewEndpoint(r.Config.URL) + endpoint, err := common.NewEndpoint(r.c.URL) if err != nil { return err } @@ -190,10 +189,6 @@ func (r *Remote) Refs() core.ReferenceIter { // Disconnect from the remote and save the config func (r *Remote) Disconnect() error { - if err := r.s.ConfigStorage().SetRemote(r.Config); err != nil { - return err - } - r.upInfo = nil return r.upSrv.Disconnect() } |