diff options
author | Santiago M. Mola <santi@mola.io> | 2017-06-13 16:01:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-13 16:01:06 +0200 |
commit | beab77aaed6ac84cbf97704f5507eae40350fefa (patch) | |
tree | 25905da2442b2363d0d45bba07485543e5665deb /plumbing/transport/test | |
parent | 2a00316b65585be2bf68e1ea9c0e42c6af4f5679 (diff) | |
parent | cbbd2a9ad8ee990c79bd847b0df2823e2449ea4e (diff) | |
download | go-git-beab77aaed6ac84cbf97704f5507eae40350fefa.tar.gz |
Merge pull request #418 from smola/ssh-issue-310
fix push on git and ssh
Diffstat (limited to 'plumbing/transport/test')
-rw-r--r-- | plumbing/transport/test/receive_pack.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plumbing/transport/test/receive_pack.go b/plumbing/transport/test/receive_pack.go index f4be8c8..bb1c58a 100644 --- a/plumbing/transport/test/receive_pack.go +++ b/plumbing/transport/test/receive_pack.go @@ -39,10 +39,10 @@ func (s *ReceivePackSuite) TestAdvertisedReferencesEmpty(c *C) { func (s *ReceivePackSuite) TestAdvertisedReferencesNotExists(c *C) { r, err := s.Client.NewReceivePackSession(s.NonExistentEndpoint, s.EmptyAuth) c.Assert(err, IsNil) - defer func() { c.Assert(r.Close(), IsNil) }() ar, err := r.AdvertisedReferences() c.Assert(err, Equals, transport.ErrRepositoryNotFound) c.Assert(ar, IsNil) + c.Assert(r.Close(), IsNil) r, err = s.Client.NewReceivePackSession(s.NonExistentEndpoint, s.EmptyAuth) c.Assert(err, IsNil) @@ -54,6 +54,7 @@ func (s *ReceivePackSuite) TestAdvertisedReferencesNotExists(c *C) { writer, err := r.ReceivePack(req) c.Assert(err, Equals, transport.ErrRepositoryNotFound) c.Assert(writer, IsNil) + c.Assert(r.Close(), IsNil) } func (s *ReceivePackSuite) TestCallAdvertisedReferenceTwice(c *C) { @@ -270,7 +271,6 @@ func (s *ReceivePackSuite) TestSendPackAddDeleteReference(c *C) { func (s *ReceivePackSuite) testSendPackAddReference(c *C) { r, err := s.Client.NewReceivePackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) - defer func() { c.Assert(r.Close(), IsNil) }() fixture := fixtures.Basic().ByTag("packfile").One() @@ -285,6 +285,8 @@ func (s *ReceivePackSuite) testSendPackAddReference(c *C) { req.Capabilities.Set(capability.ReportStatus) } + c.Assert(r.Close(), IsNil) + s.receivePack(c, s.Endpoint, req, nil, false) s.checkRemoteReference(c, s.Endpoint, "refs/heads/newbranch", fixture.Head) } @@ -292,7 +294,6 @@ func (s *ReceivePackSuite) testSendPackAddReference(c *C) { func (s *ReceivePackSuite) testSendPackDeleteReference(c *C) { r, err := s.Client.NewReceivePackSession(s.Endpoint, s.EmptyAuth) c.Assert(err, IsNil) - defer func() { c.Assert(r.Close(), IsNil) }() fixture := fixtures.Basic().ByTag("packfile").One() @@ -307,6 +308,8 @@ func (s *ReceivePackSuite) testSendPackDeleteReference(c *C) { req.Capabilities.Set(capability.ReportStatus) } + c.Assert(r.Close(), IsNil) + s.receivePack(c, s.Endpoint, req, nil, false) s.checkRemoteReference(c, s.Endpoint, "refs/heads/newbranch", plumbing.ZeroHash) } |