aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format
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
parent2bdfd91f04068220a72feeade31defc09f2a601e (diff)
downloadgo-git-2637279338ca9736c22b5e15fca916121ae8d089.tar.gz
*: migration from go-git-fixtures/v4 and go-git/gcfg
Diffstat (limited to 'plumbing/format')
-rw-r--r--plumbing/format/commitgraph/commitgraph_test.go2
-rw-r--r--plumbing/format/config/decoder.go2
-rw-r--r--plumbing/format/idxfile/decoder_test.go8
-rw-r--r--plumbing/format/idxfile/encoder_test.go2
-rw-r--r--plumbing/format/idxfile/idxfile_test.go2
-rw-r--r--plumbing/format/idxfile/writer_test.go2
-rw-r--r--plumbing/format/index/decoder_test.go2
-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
12 files changed, 20 insertions, 32 deletions
diff --git a/plumbing/format/commitgraph/commitgraph_test.go b/plumbing/format/commitgraph/commitgraph_test.go
index ebfe7e2..7d7444b 100644
--- a/plumbing/format/commitgraph/commitgraph_test.go
+++ b/plumbing/format/commitgraph/commitgraph_test.go
@@ -7,7 +7,7 @@ import (
"testing"
. "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/commitgraph"
)
diff --git a/plumbing/format/config/decoder.go b/plumbing/format/config/decoder.go
index 0f02ce1..8e52d57 100644
--- a/plumbing/format/config/decoder.go
+++ b/plumbing/format/config/decoder.go
@@ -3,7 +3,7 @@ package config
import (
"io"
- "github.com/src-d/gcfg"
+ "github.com/go-git/gcfg"
)
// A Decoder reads and decodes config files from an input stream.
diff --git a/plumbing/format/idxfile/decoder_test.go b/plumbing/format/idxfile/decoder_test.go
index 286fe6f..467e242 100644
--- a/plumbing/format/idxfile/decoder_test.go
+++ b/plumbing/format/idxfile/decoder_test.go
@@ -11,8 +11,8 @@ import (
"github.com/go-git/go-git/v5/plumbing"
. "github.com/go-git/go-git/v5/plumbing/format/idxfile"
+ 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) }
@@ -48,7 +48,7 @@ func (s *IdxfileSuite) TestDecode(c *C) {
c.Assert(crc32, Equals, uint32(3645019190))
c.Assert(fmt.Sprintf("%x", idx.IdxChecksum), Equals, "fb794f1ec720b9bc8e43257451bd99c4be6fa1c9")
- c.Assert(fmt.Sprintf("%x", idx.PackfileChecksum), Equals, f.PackfileHash.String())
+ c.Assert(fmt.Sprintf("%x", idx.PackfileChecksum), Equals, f.PackfileHash)
}
func (s *IdxfileSuite) TestDecode64bitsOffsets(c *C) {
@@ -118,10 +118,6 @@ ch2xUA==
`
func BenchmarkDecode(b *testing.B) {
- if err := fixtures.Init(); err != nil {
- b.Errorf("unexpected error initializing fixtures: %s", err)
- }
-
f := fixtures.Basic().One()
fixture, err := ioutil.ReadAll(f.Idx())
if err != nil {
diff --git a/plumbing/format/idxfile/encoder_test.go b/plumbing/format/idxfile/encoder_test.go
index 9321f4f..81abb3b 100644
--- a/plumbing/format/idxfile/encoder_test.go
+++ b/plumbing/format/idxfile/encoder_test.go
@@ -7,7 +7,7 @@ import (
. "github.com/go-git/go-git/v5/plumbing/format/idxfile"
. "gopkg.in/check.v1"
- "gopkg.in/src-d/go-git-fixtures.v3"
+ "github.com/go-git/go-git-fixtures/v4"
)
func (s *IdxfileSuite) TestDecodeEncode(c *C) {
diff --git a/plumbing/format/idxfile/idxfile_test.go b/plumbing/format/idxfile/idxfile_test.go
index ddb561b..5ef73d7 100644
--- a/plumbing/format/idxfile/idxfile_test.go
+++ b/plumbing/format/idxfile/idxfile_test.go
@@ -11,7 +11,7 @@ import (
"github.com/go-git/go-git/v5/plumbing/format/idxfile"
. "gopkg.in/check.v1"
- "gopkg.in/src-d/go-git-fixtures.v3"
+ "github.com/go-git/go-git-fixtures/v4"
)
func BenchmarkFindOffset(b *testing.B) {
diff --git a/plumbing/format/idxfile/writer_test.go b/plumbing/format/idxfile/writer_test.go
index 5ced785..f86342f 100644
--- a/plumbing/format/idxfile/writer_test.go
+++ b/plumbing/format/idxfile/writer_test.go
@@ -10,7 +10,7 @@ import (
"github.com/go-git/go-git/v5/plumbing/format/packfile"
. "gopkg.in/check.v1"
- "gopkg.in/src-d/go-git-fixtures.v3"
+ "github.com/go-git/go-git-fixtures/v4"
)
type WriterSuite struct {
diff --git a/plumbing/format/index/decoder_test.go b/plumbing/format/index/decoder_test.go
index 3555f7b..4e47dde 100644
--- a/plumbing/format/index/decoder_test.go
+++ b/plumbing/format/index/decoder_test.go
@@ -7,7 +7,7 @@ import (
"github.com/go-git/go-git/v5/plumbing/filemode"
. "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/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) {