aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-03-10 01:41:19 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2020-03-10 01:41:19 +0100
commit2637279338ca9736c22b5e15fca916121ae8d089 (patch)
tree2273e55f2d2b68b9b6335924d6b00ddf3417e8e7 /plumbing/format/packfile
parent2bdfd91f04068220a72feeade31defc09f2a601e (diff)
downloadgo-git-2637279338ca9736c22b5e15fca916121ae8d089.tar.gz
*: migration from go-git-fixtures/v4 and go-git/gcfg
Diffstat (limited to 'plumbing/format/packfile')
-rw-r--r--plumbing/format/packfile/encoder_advanced_test.go2
-rw-r--r--plumbing/format/packfile/encoder_test.go2
-rw-r--r--plumbing/format/packfile/packfile_test.go8
-rw-r--r--plumbing/format/packfile/parser_test.go14
-rw-r--r--plumbing/format/packfile/scanner_test.go6
5 files changed, 12 insertions, 20 deletions
diff --git a/plumbing/format/packfile/encoder_advanced_test.go b/plumbing/format/packfile/encoder_advanced_test.go
index e63b5b5..21bf3ae 100644
--- a/plumbing/format/packfile/encoder_advanced_test.go
+++ b/plumbing/format/packfile/encoder_advanced_test.go
@@ -15,7 +15,7 @@ import (
"github.com/go-git/go-git/v5/storage/filesystem"
. "gopkg.in/check.v1"
- "gopkg.in/src-d/go-git-fixtures.v3"
+ "github.com/go-git/go-git-fixtures/v4"
)
type EncoderAdvancedSuite struct {
diff --git a/plumbing/format/packfile/encoder_test.go b/plumbing/format/packfile/encoder_test.go
index 1721625..80d1e73 100644
--- a/plumbing/format/packfile/encoder_test.go
+++ b/plumbing/format/packfile/encoder_test.go
@@ -11,7 +11,7 @@ import (
"github.com/go-git/go-git/v5/storage/memory"
. "gopkg.in/check.v1"
- "gopkg.in/src-d/go-git-fixtures.v3"
+ "github.com/go-git/go-git-fixtures/v4"
)
type EncoderSuite struct {
diff --git a/plumbing/format/packfile/packfile_test.go b/plumbing/format/packfile/packfile_test.go
index 882a907..8b1b934 100644
--- a/plumbing/format/packfile/packfile_test.go
+++ b/plumbing/format/packfile/packfile_test.go
@@ -5,12 +5,12 @@ import (
"math"
"github.com/go-git/go-billy/v5/osfs"
- . "gopkg.in/check.v1"
- fixtures "gopkg.in/src-d/go-git-fixtures.v3"
+ fixtures "github.com/go-git/go-git-fixtures/v4"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/format/idxfile"
"github.com/go-git/go-git/v5/plumbing/format/packfile"
"github.com/go-git/go-git/v5/plumbing/storer"
+ . "gopkg.in/check.v1"
)
type PackfileSuite struct {
@@ -49,7 +49,7 @@ func (s *PackfileSuite) TestGetByOffset(c *C) {
func (s *PackfileSuite) TestID(c *C) {
id, err := s.p.ID()
c.Assert(err, IsNil)
- c.Assert(id, Equals, s.f.PackfileHash)
+ c.Assert(id.String(), Equals, s.f.PackfileHash)
}
func (s *PackfileSuite) TestGetAll(c *C) {
@@ -297,7 +297,7 @@ func (s *PackfileSuite) TestSize(c *C) {
c.Assert(size, Equals, int64(76110))
// Get the size of the root commit, which is delta-encoded.
- offset, err = packfile.FindOffset(f.Head)
+ offset, err = packfile.FindOffset(plumbing.NewHash(f.Head))
c.Assert(err, IsNil)
size, err = packfile.GetSizeByOffset(offset)
c.Assert(err, IsNil)
diff --git a/plumbing/format/packfile/parser_test.go b/plumbing/format/packfile/parser_test.go
index 9d97cef..fb5fb7f 100644
--- a/plumbing/format/packfile/parser_test.go
+++ b/plumbing/format/packfile/parser_test.go
@@ -9,8 +9,8 @@ import (
"github.com/go-git/go-git/v5/plumbing/format/packfile"
"github.com/go-git/go-git/v5/plumbing/storer"
+ fixtures "github.com/go-git/go-git-fixtures/v4"
. "gopkg.in/check.v1"
- "gopkg.in/src-d/go-git-fixtures.v3"
)
type ParserSuite struct {
@@ -106,7 +106,7 @@ func (s *ParserSuite) TestThinPack(c *C) {
w.Close()
// Check that the test object that will come with our thin pack is *not* in the repo
- _, err = fs.Storer.EncodedObject(plumbing.CommitObject, thinpack.Head)
+ _, err = fs.Storer.EncodedObject(plumbing.CommitObject, plumbing.NewHash(thinpack.Head))
c.Assert(err, Equals, plumbing.ErrObjectNotFound)
// Now unpack the thin pack:
@@ -119,7 +119,7 @@ func (s *ParserSuite) TestThinPack(c *C) {
c.Assert(h, Equals, plumbing.NewHash("1288734cbe0b95892e663221d94b95de1f5d7be8"))
// Check that our test object is now accessible
- _, err = fs.Storer.EncodedObject(plumbing.CommitObject, thinpack.Head)
+ _, err = fs.Storer.EncodedObject(plumbing.CommitObject, plumbing.NewHash(thinpack.Head))
c.Assert(err, IsNil)
}
@@ -192,10 +192,6 @@ func (t *testObserver) put(pos int64, o observerObject) {
}
func BenchmarkParse(b *testing.B) {
- if err := fixtures.Init(); err != nil {
- b.Fatal(err)
- }
-
defer func() {
if err := fixtures.Clean(); err != nil {
b.Fatal(err)
@@ -220,10 +216,6 @@ func BenchmarkParse(b *testing.B) {
}
func BenchmarkParseBasic(b *testing.B) {
- if err := fixtures.Init(); err != nil {
- b.Fatal(err)
- }
-
defer func() {
if err := fixtures.Clean(); err != nil {
b.Fatal(err)
diff --git a/plumbing/format/packfile/scanner_test.go b/plumbing/format/packfile/scanner_test.go
index 5c1d5c9..892a27c 100644
--- a/plumbing/format/packfile/scanner_test.go
+++ b/plumbing/format/packfile/scanner_test.go
@@ -4,10 +4,10 @@ import (
"bytes"
"io"
+ fixtures "github.com/go-git/go-git-fixtures/v4"
"github.com/go-git/go-git/v5/plumbing"
. "gopkg.in/check.v1"
- "gopkg.in/src-d/go-git-fixtures.v3"
)
type ScannerSuite struct {
@@ -93,7 +93,7 @@ func (s *ScannerSuite) TestNextObjectHeaderWithOutReadObject(c *C) {
n, err := p.Checksum()
c.Assert(err, IsNil)
- c.Assert(n, Equals, f.PackfileHash)
+ c.Assert(n.String(), Equals, f.PackfileHash)
}
func (s *ScannerSuite) TestNextObjectHeaderWithOutReadObjectNonSeekable(c *C) {
@@ -115,7 +115,7 @@ func (s *ScannerSuite) TestNextObjectHeaderWithOutReadObjectNonSeekable(c *C) {
n, err := p.Checksum()
c.Assert(err, IsNil)
- c.Assert(n, Equals, f.PackfileHash)
+ c.Assert(n.String(), Equals, f.PackfileHash)
}
func (s *ScannerSuite) TestSeekObjectHeader(c *C) {