aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-30 14:42:19 +0100
committerGitHub <noreply@github.com>2017-01-30 14:42:19 +0100
commita48bc6e17ef6298f93ec21cdf1a5e387640673b6 (patch)
treed2fa569b6c2c7699fa6f7c2a60b9bce90f1e55f8 /remote.go
parent77b6391a050743f3f0aa46018db65853c7167df5 (diff)
downloadgo-git-a48bc6e17ef6298f93ec21cdf1a5e387640673b6.tar.gz
Repository.Progress moved as a field in *Options (#237)
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/remote.go b/remote.go
index a071b07..8fa6378 100644
--- a/remote.go
+++ b/remote.go
@@ -26,11 +26,10 @@ var NoErrAlreadyUpToDate = errors.New("already up-to-date")
type Remote struct {
c *config.RemoteConfig
s Storer
- p sideband.Progress
}
-func newRemote(s Storer, p sideband.Progress, c *config.RemoteConfig) *Remote {
- return &Remote{s: s, p: p, c: c}
+func newRemote(s Storer, c *config.RemoteConfig) *Remote {
+ return &Remote{s: s, c: c}
}
// Config return the config
@@ -59,6 +58,7 @@ func (r *Remote) Fetch(o *FetchOptions) error {
// TODO: Support deletes.
// TODO: Support pushing tags.
// TODO: Check if force update is given, otherwise reject non-fast forward.
+// TODO: Sideband support
func (r *Remote) Push(o *PushOptions) (err error) {
if o.RemoteName == "" {
o.RemoteName = r.c.Name
@@ -222,7 +222,7 @@ func (r *Remote) fetchPack(o *FetchOptions, s transport.UploadPackSession,
}
if err = packfile.UpdateObjectStorage(r.s,
- buildSidebandIfSupported(req.Capabilities, reader, r.p),
+ buildSidebandIfSupported(req.Capabilities, reader, o.Progress),
); err != nil {
return err
}
@@ -400,7 +400,7 @@ func (r *Remote) newUploadPackRequest(o *FetchOptions,
}
}
- if r.p == nil && ar.Capabilities.Supports(capability.NoProgress) {
+ if o.Progress == nil && ar.Capabilities.Supports(capability.NoProgress) {
if err := req.Capabilities.Set(capability.NoProgress); err != nil {
return nil, err
}