diff options
author | Santiago M. Mola <santi@mola.io> | 2016-11-28 09:57:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-28 09:57:38 +0100 |
commit | 68893edf9ddc3de181431f1552e3b773cb66f080 (patch) | |
tree | f45e5fa18e10168a278b7d0ed7dea984ff9969f7 /plumbing/transport/test/common.go | |
parent | f9adb3565b36ba1573102f954d0ee916009efac2 (diff) | |
download | go-git-68893edf9ddc3de181431f1552e3b773cb66f080.tar.gz |
remove old types from transport and use packp (#142)
* protocol: move UploadPackRequest to protocol.
* UploadPackRequest is now defined as an embedding of UploadRequest and
UploadHaves.
* Move http encoding specific code from UploadPackRequest to transport/http.
* rename UlReq to UploadRequest
* packp: move AdvRefs Encoder/Decoder to Encode/Decode methods.
* packp: move UploadRequest Encoder/Decoder to Encode/Decode methods.
* packp: Remove transport.UploadPackInfo in favor of packp. AdvRefs.
Diffstat (limited to 'plumbing/transport/test/common.go')
-rw-r--r-- | plumbing/transport/test/common.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plumbing/transport/test/common.go b/plumbing/transport/test/common.go index 059c0c9..7818fbb 100644 --- a/plumbing/transport/test/common.go +++ b/plumbing/transport/test/common.go @@ -10,6 +10,7 @@ import ( "gopkg.in/src-d/go-git.v4/plumbing" "gopkg.in/src-d/go-git.v4/plumbing/format/packfile" + "gopkg.in/src-d/go-git.v4/plumbing/protocol/packp" "gopkg.in/src-d/go-git.v4/plumbing/transport" "gopkg.in/src-d/go-git.v4/storage/memory" @@ -40,7 +41,7 @@ func (s *FetchPackSuite) TestInfoNotExists(c *C) { r, err = s.Client.NewFetchPackSession(s.NonExistentEndpoint) c.Assert(err, IsNil) - req := &transport.UploadPackRequest{} + req := packp.NewUploadPackRequest() req.Want(plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) reader, err := r.FetchPack(req) c.Assert(err, Equals, transport.ErrRepositoryNotFound) @@ -85,7 +86,7 @@ func (s *FetchPackSuite) TestFullFetchPack(c *C) { c.Assert(err, IsNil) c.Assert(info, NotNil) - req := &transport.UploadPackRequest{} + req := packp.NewUploadPackRequest() req.Want(plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) reader, err := r.FetchPack(req) @@ -99,7 +100,7 @@ func (s *FetchPackSuite) TestFetchPack(c *C) { c.Assert(err, IsNil) defer func() { c.Assert(r.Close(), IsNil) }() - req := &transport.UploadPackRequest{} + req := packp.NewUploadPackRequest() req.Want(plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) reader, err := r.FetchPack(req) @@ -113,7 +114,7 @@ func (s *FetchPackSuite) TestFetchPackNoChanges(c *C) { c.Assert(err, IsNil) defer func() { c.Assert(r.Close(), IsNil) }() - req := &transport.UploadPackRequest{} + req := packp.NewUploadPackRequest() req.Want(plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) req.Have(plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) @@ -127,7 +128,7 @@ func (s *FetchPackSuite) TestFetchPackMulti(c *C) { c.Assert(err, IsNil) defer func() { c.Assert(r.Close(), IsNil) }() - req := &transport.UploadPackRequest{} + req := packp.NewUploadPackRequest() req.Want(plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) req.Want(plumbing.NewHash("e8d3ffab552895c19b9fcf7aa264d277cde33881")) @@ -141,7 +142,7 @@ func (s *FetchPackSuite) TestFetchError(c *C) { r, err := s.Client.NewFetchPackSession(s.Endpoint) c.Assert(err, IsNil) - req := &transport.UploadPackRequest{} + req := packp.NewUploadPackRequest() req.Want(plumbing.NewHash("1111111111111111111111111111111111111111")) reader, err := r.FetchPack(req) |