diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-09-01 17:28:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-01 17:28:42 +0200 |
commit | c20028f6a4d0038d59898392aafe13baa9e84040 (patch) | |
tree | 49407f8b3b5aaef1c6a56363bdb1fc25cd56f5cb /plumbing/transport/http/receive_pack.go | |
parent | 8ce9f5f240730ce21f50e42409d17fac7d71e051 (diff) | |
parent | 76efca13092ba245caf15f232f467e68fa1f73ed (diff) | |
download | go-git-c20028f6a4d0038d59898392aafe13baa9e84040.tar.gz |
Merge pull request #573 from orirawlings/pushSideband
Add sideband support for push
Diffstat (limited to 'plumbing/transport/http/receive_pack.go')
-rw-r--r-- | plumbing/transport/http/receive_pack.go | 13 |
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() |