aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/http
diff options
context:
space:
mode:
authorOri Rawlings <orirawlings@gmail.com>2017-08-23 21:37:49 -0500
committerOri Rawlings <orirawlings@gmail.com>2017-09-01 09:17:23 -0500
commit76efca13092ba245caf15f232f467e68fa1f73ed (patch)
treee94ed3536e5af8d9201e83de9a7011ab5ac37dad /plumbing/transport/http
parent3ca370277427c5d508f0dedacbd559523a305121 (diff)
downloadgo-git-76efca13092ba245caf15f232f467e68fa1f73ed.tar.gz
Add sideband support for push
Diffstat (limited to 'plumbing/transport/http')
-rw-r--r--plumbing/transport/http/receive_pack.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/plumbing/transport/http/receive_pack.go b/plumbing/transport/http/receive_pack.go
index b54b70f..d2dfeb7 100644
--- a/plumbing/transport/http/receive_pack.go
+++ b/plumbing/transport/http/receive_pack.go
@@ -9,6 +9,8 @@ import (
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/protocol/packp"
+ "gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/capability"
+ "gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/sideband"
"gopkg.in/src-d/go-git.v4/plumbing/transport"
"gopkg.in/src-d/go-git.v4/utils/ioutil"
)
@@ -52,6 +54,17 @@ func (s *rpSession) ReceivePack(ctx context.Context, req *packp.ReferenceUpdateR
return nil, err
}
+ var d *sideband.Demuxer
+ if req.Capabilities.Supports(capability.Sideband64k) {
+ d = sideband.NewDemuxer(sideband.Sideband64k, r)
+ } else if req.Capabilities.Supports(capability.Sideband) {
+ d = sideband.NewDemuxer(sideband.Sideband, r)
+ }
+ if d != nil {
+ d.Progress = req.Progress
+ r = d
+ }
+
rc := ioutil.NewReadCloser(r, res.Body)
report := packp.NewReportStatus()