diff options
author | Santiago M. Mola <santi@mola.io> | 2016-12-08 14:24:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-08 14:24:25 +0100 |
commit | 7d9d9bfee34ea428a127da0df900d3a26de37c38 (patch) | |
tree | 225c5661c6be1a000c2e5cc15961c214040c7cff /plumbing/transport/test | |
parent | 3962b8d4dbb2d2d61e9282d73f8d3d0f2a222461 (diff) | |
download | go-git-7d9d9bfee34ea428a127da0df900d3a26de37c38.tar.gz |
plumbing/transport: allow AdvertisedReferences being called multiple times. (#165)
* AdvertisedReferences is now part of transport.Session.
* It is allowed to be called more than once.
* It is allowed to be called before and after FetchPack/SendPack.
* Implementations cache its result.
Diffstat (limited to 'plumbing/transport/test')
-rw-r--r-- | plumbing/transport/test/common.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plumbing/transport/test/common.go b/plumbing/transport/test/common.go index 3b7f05f..2984154 100644 --- a/plumbing/transport/test/common.go +++ b/plumbing/transport/test/common.go @@ -49,13 +49,15 @@ func (s *FetchPackSuite) TestInfoNotExists(c *C) { c.Assert(reader, IsNil) } -func (s *FetchPackSuite) TestCannotCallAdvertisedReferenceTwice(c *C) { +func (s *FetchPackSuite) TestCallAdvertisedReferenceTwice(c *C) { r, err := s.Client.NewFetchPackSession(s.Endpoint) c.Assert(err, IsNil) - _, err = r.AdvertisedReferences() + ar1, err := r.AdvertisedReferences() c.Assert(err, IsNil) - _, err = r.AdvertisedReferences() - c.Assert(err, Equals, transport.ErrAdvertistedReferencesAlreadyCalled) + c.Assert(ar1, NotNil) + ar2, err := r.AdvertisedReferences() + c.Assert(err, IsNil) + c.Assert(ar2, DeepEquals, ar1) } func (s *FetchPackSuite) TestDefaultBranch(c *C) { |