diff options
author | Antonio Navarro Perez <antnavper@gmail.com> | 2017-01-25 00:30:09 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-01-25 00:30:09 +0100 |
commit | dc45de29f87a43078356a5be4c4b5aa24f626ee0 (patch) | |
tree | a36e94fedc5d82155c67857f8e8a8632fb15ff1e /plumbing/transport/test | |
parent | e549c1819773fd8ab302ecd1b7650c25aafaba43 (diff) | |
download | go-git-dc45de29f87a43078356a5be4c4b5aa24f626ee0.tar.gz |
transport/http: fix partial request with haves. Fix #216. (#221)
Diffstat (limited to 'plumbing/transport/test')
-rw-r--r-- | plumbing/transport/test/upload_pack.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plumbing/transport/test/upload_pack.go b/plumbing/transport/test/upload_pack.go index c1a9050..06ae893 100644 --- a/plumbing/transport/test/upload_pack.go +++ b/plumbing/transport/test/upload_pack.go @@ -168,6 +168,21 @@ func (s *UploadPackSuite) TestUploadPackMulti(c *C) { s.checkObjectNumber(c, reader, 31) } +func (s *UploadPackSuite) TestUploadPackPartial(c *C) { + r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) + c.Assert(err, IsNil) + defer func() { c.Assert(r.Close(), IsNil) }() + + req := packp.NewUploadPackRequest() + req.Wants = append(req.Wants, plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) + req.Haves = append(req.Haves, plumbing.NewHash("918c48b83bd081e863dbe1b80f8998f058cd8294")) + + reader, err := r.UploadPack(req) + c.Assert(err, IsNil) + + s.checkObjectNumber(c, reader, 4) +} + func (s *UploadPackSuite) TestFetchError(c *C) { r, err := s.Client.NewUploadPackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) |