diff options
Diffstat (limited to 'plumbing/transport')
-rw-r--r-- | plumbing/transport/file/common_test.go | 4 | ||||
-rw-r--r-- | plumbing/transport/file/receive_pack_test.go | 2 | ||||
-rw-r--r-- | plumbing/transport/file/server_test.go | 2 | ||||
-rw-r--r-- | plumbing/transport/file/upload_pack_test.go | 6 | ||||
-rw-r--r-- | plumbing/transport/git/common_test.go | 2 | ||||
-rw-r--r-- | plumbing/transport/git/receive_pack_test.go | 2 | ||||
-rw-r--r-- | plumbing/transport/git/upload_pack_test.go | 2 | ||||
-rw-r--r-- | plumbing/transport/http/common_test.go | 2 | ||||
-rw-r--r-- | plumbing/transport/http/receive_pack_test.go | 2 | ||||
-rw-r--r-- | plumbing/transport/http/upload_pack_test.go | 2 | ||||
-rw-r--r-- | plumbing/transport/server/server_test.go | 3 | ||||
-rw-r--r-- | plumbing/transport/ssh/upload_pack_test.go | 4 | ||||
-rw-r--r-- | plumbing/transport/test/receive_pack.go | 40 |
13 files changed, 33 insertions, 40 deletions
diff --git a/plumbing/transport/file/common_test.go b/plumbing/transport/file/common_test.go index 99866d7..4d6612b 100644 --- a/plumbing/transport/file/common_test.go +++ b/plumbing/transport/file/common_test.go @@ -6,8 +6,8 @@ import ( "os/exec" "path/filepath" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) type CommonSuite struct { @@ -20,8 +20,6 @@ type CommonSuite struct { var _ = Suite(&CommonSuite{}) func (s *CommonSuite) SetUpSuite(c *C) { - s.Suite.SetUpSuite(c) - if err := exec.Command("git", "--version").Run(); err != nil { c.Skip("git command not found") } diff --git a/plumbing/transport/file/receive_pack_test.go b/plumbing/transport/file/receive_pack_test.go index 46a0017..2ee4b86 100644 --- a/plumbing/transport/file/receive_pack_test.go +++ b/plumbing/transport/file/receive_pack_test.go @@ -6,7 +6,7 @@ import ( "github.com/go-git/go-git/v5/plumbing/transport/test" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) type ReceivePackSuite struct { diff --git a/plumbing/transport/file/server_test.go b/plumbing/transport/file/server_test.go index 1793c0f..b6ac4e0 100644 --- a/plumbing/transport/file/server_test.go +++ b/plumbing/transport/file/server_test.go @@ -4,8 +4,8 @@ import ( "os" "os/exec" + "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) type ServerSuite struct { diff --git a/plumbing/transport/file/upload_pack_test.go b/plumbing/transport/file/upload_pack_test.go index 1f210aa..fe7c6af 100644 --- a/plumbing/transport/file/upload_pack_test.go +++ b/plumbing/transport/file/upload_pack_test.go @@ -2,13 +2,12 @@ package file import ( "os" - "path/filepath" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/plumbing/transport/test" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) type UploadPackSuite struct { @@ -35,8 +34,7 @@ func (s *UploadPackSuite) SetUpSuite(c *C) { c.Assert(err, IsNil) s.EmptyEndpoint = ep - path = filepath.Join(fixtures.DataFolder, "non-existent") - ep, err = transport.NewEndpoint(path) + ep, err = transport.NewEndpoint("non-existent") c.Assert(err, IsNil) s.NonExistentEndpoint = ep } diff --git a/plumbing/transport/git/common_test.go b/plumbing/transport/git/common_test.go index 62eeef9..551b50d 100644 --- a/plumbing/transport/git/common_test.go +++ b/plumbing/transport/git/common_test.go @@ -14,7 +14,7 @@ import ( "github.com/go-git/go-git/v5/plumbing/transport" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) func Test(t *testing.T) { TestingT(t) } diff --git a/plumbing/transport/git/receive_pack_test.go b/plumbing/transport/git/receive_pack_test.go index 44989a4..1f730a4 100644 --- a/plumbing/transport/git/receive_pack_test.go +++ b/plumbing/transport/git/receive_pack_test.go @@ -4,7 +4,7 @@ import ( "github.com/go-git/go-git/v5/plumbing/transport/test" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) type ReceivePackSuite struct { diff --git a/plumbing/transport/git/upload_pack_test.go b/plumbing/transport/git/upload_pack_test.go index 6d10363..bbfdf58 100644 --- a/plumbing/transport/git/upload_pack_test.go +++ b/plumbing/transport/git/upload_pack_test.go @@ -4,7 +4,7 @@ import ( "github.com/go-git/go-git/v5/plumbing/transport/test" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) type UploadPackSuite struct { diff --git a/plumbing/transport/http/common_test.go b/plumbing/transport/http/common_test.go index d413558..5811139 100644 --- a/plumbing/transport/http/common_test.go +++ b/plumbing/transport/http/common_test.go @@ -18,7 +18,7 @@ import ( "github.com/go-git/go-git/v5/plumbing/transport" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) func Test(t *testing.T) { TestingT(t) } diff --git a/plumbing/transport/http/receive_pack_test.go b/plumbing/transport/http/receive_pack_test.go index 24eaaba..b977908 100644 --- a/plumbing/transport/http/receive_pack_test.go +++ b/plumbing/transport/http/receive_pack_test.go @@ -4,7 +4,7 @@ import ( "github.com/go-git/go-git/v5/plumbing/transport/test" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) type ReceivePackSuite struct { diff --git a/plumbing/transport/http/upload_pack_test.go b/plumbing/transport/http/upload_pack_test.go index 4fc2912..b34441d 100644 --- a/plumbing/transport/http/upload_pack_test.go +++ b/plumbing/transport/http/upload_pack_test.go @@ -12,7 +12,7 @@ import ( "github.com/go-git/go-git/v5/plumbing/transport/test" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) type UploadPackSuite struct { diff --git a/plumbing/transport/server/server_test.go b/plumbing/transport/server/server_test.go index ab03ca0..24de099 100644 --- a/plumbing/transport/server/server_test.go +++ b/plumbing/transport/server/server_test.go @@ -11,8 +11,8 @@ import ( "github.com/go-git/go-git/v5/storage/filesystem" "github.com/go-git/go-git/v5/storage/memory" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) func Test(t *testing.T) { TestingT(t) } @@ -28,7 +28,6 @@ type BaseSuite struct { } func (s *BaseSuite) SetUpSuite(c *C) { - s.Suite.SetUpSuite(c) s.loader = server.MapLoader{} if s.asClient { s.client = server.NewClient(s.loader) diff --git a/plumbing/transport/ssh/upload_pack_test.go b/plumbing/transport/ssh/upload_pack_test.go index aa7344d..1bcb82b 100644 --- a/plumbing/transport/ssh/upload_pack_test.go +++ b/plumbing/transport/ssh/upload_pack_test.go @@ -16,9 +16,9 @@ import ( "github.com/go-git/go-git/v5/plumbing/transport/test" "github.com/gliderlabs/ssh" + fixtures "github.com/go-git/go-git-fixtures/v4" stdssh "golang.org/x/crypto/ssh" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) type UploadPackSuite struct { @@ -32,8 +32,6 @@ type UploadPackSuite struct { var _ = Suite(&UploadPackSuite{}) func (s *UploadPackSuite) SetUpSuite(c *C) { - s.Suite.SetUpSuite(c) - l, err := net.Listen("tcp", "localhost:0") c.Assert(err, IsNil) diff --git a/plumbing/transport/test/receive_pack.go b/plumbing/transport/test/receive_pack.go index 01972b2..018d38e 100644 --- a/plumbing/transport/test/receive_pack.go +++ b/plumbing/transport/test/receive_pack.go @@ -18,8 +18,8 @@ import ( "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/storage/memory" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) type ReceivePackSuite struct { @@ -82,7 +82,7 @@ func (s *ReceivePackSuite) TestDefaultBranch(c *C) { c.Assert(err, IsNil) ref, ok := info.References["refs/heads/master"] c.Assert(ok, Equals, true) - c.Assert(ref, Equals, fixtures.Basic().One().Head) + c.Assert(ref.String(), Equals, fixtures.Basic().One().Head) } func (s *ReceivePackSuite) TestCapabilities(c *C) { @@ -101,10 +101,10 @@ func (s *ReceivePackSuite) TestFullSendPackOnEmpty(c *C) { fixture := fixtures.Basic().ByTag("packfile").One() req := packp.NewReferenceUpdateRequest() req.Commands = []*packp.Command{ - {Name: "refs/heads/master", Old: plumbing.ZeroHash, New: fixture.Head}, + {Name: "refs/heads/master", Old: plumbing.ZeroHash, New: plumbing.NewHash(fixture.Head)}, } s.receivePack(c, endpoint, req, fixture, full) - s.checkRemoteHead(c, endpoint, fixture.Head) + s.checkRemoteHead(c, endpoint, plumbing.NewHash(fixture.Head)) } func (s *ReceivePackSuite) TestSendPackWithContext(c *C) { @@ -112,7 +112,7 @@ func (s *ReceivePackSuite) TestSendPackWithContext(c *C) { req := packp.NewReferenceUpdateRequest() req.Packfile = fixture.Packfile() req.Commands = []*packp.Command{ - {Name: "refs/heads/master", Old: plumbing.ZeroHash, New: fixture.Head}, + {Name: "refs/heads/master", Old: plumbing.ZeroHash, New: plumbing.NewHash(fixture.Head)}, } r, err := s.Client.NewReceivePackSession(s.EmptyEndpoint, s.EmptyAuth) @@ -137,10 +137,10 @@ func (s *ReceivePackSuite) TestSendPackOnEmpty(c *C) { fixture := fixtures.Basic().ByTag("packfile").One() req := packp.NewReferenceUpdateRequest() req.Commands = []*packp.Command{ - {Name: "refs/heads/master", Old: plumbing.ZeroHash, New: fixture.Head}, + {Name: "refs/heads/master", Old: plumbing.ZeroHash, New: plumbing.NewHash(fixture.Head)}, } s.receivePack(c, endpoint, req, fixture, full) - s.checkRemoteHead(c, endpoint, fixture.Head) + s.checkRemoteHead(c, endpoint, plumbing.NewHash(fixture.Head)) } func (s *ReceivePackSuite) TestSendPackOnEmptyWithReportStatus(c *C) { @@ -149,11 +149,11 @@ func (s *ReceivePackSuite) TestSendPackOnEmptyWithReportStatus(c *C) { fixture := fixtures.Basic().ByTag("packfile").One() req := packp.NewReferenceUpdateRequest() req.Commands = []*packp.Command{ - {Name: "refs/heads/master", Old: plumbing.ZeroHash, New: fixture.Head}, + {Name: "refs/heads/master", Old: plumbing.ZeroHash, New: plumbing.NewHash(fixture.Head)}, } req.Capabilities.Set(capability.ReportStatus) s.receivePack(c, endpoint, req, fixture, full) - s.checkRemoteHead(c, endpoint, fixture.Head) + s.checkRemoteHead(c, endpoint, plumbing.NewHash(fixture.Head)) } func (s *ReceivePackSuite) TestFullSendPackOnNonEmpty(c *C) { @@ -162,10 +162,10 @@ func (s *ReceivePackSuite) TestFullSendPackOnNonEmpty(c *C) { fixture := fixtures.Basic().ByTag("packfile").One() req := packp.NewReferenceUpdateRequest() req.Commands = []*packp.Command{ - {Name: "refs/heads/master", Old: fixture.Head, New: fixture.Head}, + {Name: "refs/heads/master", Old: plumbing.NewHash(fixture.Head), New: plumbing.NewHash(fixture.Head)}, } s.receivePack(c, endpoint, req, fixture, full) - s.checkRemoteHead(c, endpoint, fixture.Head) + s.checkRemoteHead(c, endpoint, plumbing.NewHash(fixture.Head)) } func (s *ReceivePackSuite) TestSendPackOnNonEmpty(c *C) { @@ -174,10 +174,10 @@ func (s *ReceivePackSuite) TestSendPackOnNonEmpty(c *C) { fixture := fixtures.Basic().ByTag("packfile").One() req := packp.NewReferenceUpdateRequest() req.Commands = []*packp.Command{ - {Name: "refs/heads/master", Old: fixture.Head, New: fixture.Head}, + {Name: "refs/heads/master", Old: plumbing.NewHash(fixture.Head), New: plumbing.NewHash(fixture.Head)}, } s.receivePack(c, endpoint, req, fixture, full) - s.checkRemoteHead(c, endpoint, fixture.Head) + s.checkRemoteHead(c, endpoint, plumbing.NewHash(fixture.Head)) } func (s *ReceivePackSuite) TestSendPackOnNonEmptyWithReportStatus(c *C) { @@ -186,12 +186,12 @@ func (s *ReceivePackSuite) TestSendPackOnNonEmptyWithReportStatus(c *C) { fixture := fixtures.Basic().ByTag("packfile").One() req := packp.NewReferenceUpdateRequest() req.Commands = []*packp.Command{ - {Name: "refs/heads/master", Old: fixture.Head, New: fixture.Head}, + {Name: "refs/heads/master", Old: plumbing.NewHash(fixture.Head), New: plumbing.NewHash(fixture.Head)}, } req.Capabilities.Set(capability.ReportStatus) s.receivePack(c, endpoint, req, fixture, full) - s.checkRemoteHead(c, endpoint, fixture.Head) + s.checkRemoteHead(c, endpoint, plumbing.NewHash(fixture.Head)) } func (s *ReceivePackSuite) TestSendPackOnNonEmptyWithReportStatusWithError(c *C) { @@ -200,7 +200,7 @@ func (s *ReceivePackSuite) TestSendPackOnNonEmptyWithReportStatusWithError(c *C) fixture := fixtures.Basic().ByTag("packfile").One() req := packp.NewReferenceUpdateRequest() req.Commands = []*packp.Command{ - {Name: "refs/heads/master", Old: plumbing.ZeroHash, New: fixture.Head}, + {Name: "refs/heads/master", Old: plumbing.ZeroHash, New: plumbing.NewHash(fixture.Head)}, } req.Capabilities.Set(capability.ReportStatus) @@ -212,7 +212,7 @@ func (s *ReceivePackSuite) TestSendPackOnNonEmptyWithReportStatusWithError(c *C) c.Assert(len(report.CommandStatuses), Equals, 1) c.Assert(report.CommandStatuses[0].ReferenceName, Equals, plumbing.ReferenceName("refs/heads/master")) c.Assert(report.CommandStatuses[0].Status, Matches, "(failed to update ref|failed to lock)") - s.checkRemoteHead(c, endpoint, fixture.Head) + s.checkRemoteHead(c, endpoint, plumbing.NewHash(fixture.Head)) } func (s *ReceivePackSuite) receivePackNoCheck(c *C, ep *transport.Endpoint, @@ -324,7 +324,7 @@ func (s *ReceivePackSuite) testSendPackAddReference(c *C) { req := packp.NewReferenceUpdateRequest() req.Commands = []*packp.Command{ - {Name: "refs/heads/newbranch", Old: plumbing.ZeroHash, New: fixture.Head}, + {Name: "refs/heads/newbranch", Old: plumbing.ZeroHash, New: plumbing.NewHash(fixture.Head)}, } if ar.Capabilities.Supports(capability.ReportStatus) { req.Capabilities.Set(capability.ReportStatus) @@ -333,7 +333,7 @@ func (s *ReceivePackSuite) testSendPackAddReference(c *C) { c.Assert(r.Close(), IsNil) s.receivePack(c, s.Endpoint, req, nil, false) - s.checkRemoteReference(c, s.Endpoint, "refs/heads/newbranch", fixture.Head) + s.checkRemoteReference(c, s.Endpoint, "refs/heads/newbranch", plumbing.NewHash(fixture.Head)) } func (s *ReceivePackSuite) testSendPackDeleteReference(c *C) { @@ -347,7 +347,7 @@ func (s *ReceivePackSuite) testSendPackDeleteReference(c *C) { req := packp.NewReferenceUpdateRequest() req.Commands = []*packp.Command{ - {Name: "refs/heads/newbranch", Old: fixture.Head, New: plumbing.ZeroHash}, + {Name: "refs/heads/newbranch", Old: plumbing.NewHash(fixture.Head), New: plumbing.ZeroHash}, } if ar.Capabilities.Supports(capability.ReportStatus) { req.Capabilities.Set(capability.ReportStatus) |