aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-12-01 09:59:19 +0100
committerGitHub <noreply@github.com>2016-12-01 09:59:19 +0100
commitc15bf1dff332873644290db0e186b8f5ad9b8fb2 (patch)
tree1dd79212333823b70f2792ad116864ea127e4a1c /remote.go
parent7de79aef5d4aa3100382d4df3e99525f9949e8d1 (diff)
downloadgo-git-c15bf1dff332873644290db0e186b8f5ad9b8fb2.tar.gz
capabilities: full integration (#151)
* format/pktline: fix readPayloadLen err handling * protocol/pakp: UploadReq validation and creation of capabilities * protocol/pakp: AdvRef tests * protocol/pakp: capability.List.Delete * protocol: filter unsupported capabilities * remote capability negociation * transport: UploadRequest validation * requested changes
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/remote.go b/remote.go
index e2f9ae4..515f755 100644
--- a/remote.go
+++ b/remote.go
@@ -171,11 +171,11 @@ func (r *Remote) getWantedReferences(spec []config.RefSpec) ([]*plumbing.Referen
func (r *Remote) buildRequest(
s storer.ReferenceStorer, o *FetchOptions, refs []*plumbing.Reference,
) (*packp.UploadPackRequest, error) {
- req := packp.NewUploadPackRequest()
+ req := packp.NewUploadPackRequestFromCapabilities(r.advRefs.Capabilities)
req.Depth = packp.DepthCommits(o.Depth)
for _, ref := range refs {
- req.Want(ref.Hash())
+ req.Wants = append(req.Wants, ref.Hash())
}
i, err := s.IterReferences()
@@ -188,7 +188,7 @@ func (r *Remote) buildRequest(
return nil
}
- req.Have(ref.Hash())
+ req.Haves = append(req.Haves, ref.Hash())
return nil
})