aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/test/upload_pack.go
diff options
context:
space:
mode:
authorAntonio Navarro Perez <antnavper@gmail.com>2017-01-25 00:30:09 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-01-25 00:30:09 +0100
commitdc45de29f87a43078356a5be4c4b5aa24f626ee0 (patch)
treea36e94fedc5d82155c67857f8e8a8632fb15ff1e /plumbing/transport/test/upload_pack.go
parente549c1819773fd8ab302ecd1b7650c25aafaba43 (diff)
downloadgo-git-dc45de29f87a43078356a5be4c4b5aa24f626ee0.tar.gz
transport/http: fix partial request with haves. Fix #216. (#221)
Diffstat (limited to 'plumbing/transport/test/upload_pack.go')
-rw-r--r--plumbing/transport/test/upload_pack.go15
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)