aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-30 16:13:56 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-01-30 16:13:56 +0100
commit35378e7db9288e8244f2634a1b47981606731cef (patch)
tree65936a6a365263c93e4b57c3b67aad6a13489e68 /remote.go
parent45669655f026a31577f938ee70ae613c2e4af184 (diff)
parenta48bc6e17ef6298f93ec21cdf1a5e387640673b6 (diff)
downloadgo-git-35378e7db9288e8244f2634a1b47981606731cef.tar.gz
example: using new constructors
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
}