diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2020-03-10 01:41:19 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2020-03-10 01:41:19 +0100 |
commit | 2637279338ca9736c22b5e15fca916121ae8d089 (patch) | |
tree | 2273e55f2d2b68b9b6335924d6b00ddf3417e8e7 | |
parent | 2bdfd91f04068220a72feeade31defc09f2a601e (diff) | |
download | go-git-2637279338ca9736c22b5e15fca916121ae8d089.tar.gz |
*: migration from go-git-fixtures/v4 and go-git/gcfg
58 files changed, 115 insertions, 184 deletions
diff --git a/blame_test.go b/blame_test.go index b39f1dd..398f839 100644 --- a/blame_test.go +++ b/blame_test.go @@ -5,7 +5,7 @@ import ( "github.com/go-git/go-git/v5/plumbing/object" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) type BlameSuite struct { diff --git a/common_test.go b/common_test.go index 6d8e8d0..8154359 100644 --- a/common_test.go +++ b/common_test.go @@ -13,8 +13,8 @@ import ( "github.com/go-git/go-billy/v5" "github.com/go-git/go-billy/v5/memfs" "github.com/go-git/go-billy/v5/util" + 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.buildBasicRepository(c) s.cache = make(map[string]*Repository) @@ -99,7 +98,7 @@ func (s *BaseSuite) NewRepositoryWithEmptyWorktree(f *fixtures.Fixture) *Reposit } func (s *BaseSuite) NewRepositoryFromPackfile(f *fixtures.Fixture) *Repository { - h := f.PackfileHash.String() + h := f.PackfileHash if r, ok := s.cache[h]; ok { return r } @@ -112,7 +111,7 @@ func (s *BaseSuite) NewRepositoryFromPackfile(f *fixtures.Fixture) *Repository { panic(err) } - storer.SetReference(plumbing.NewHashReference(plumbing.HEAD, f.Head)) + storer.SetReference(plumbing.NewHashReference(plumbing.HEAD, plumbing.NewHash(f.Head))) r, err := Open(storer, memfs.New()) if err != nil { @@ -1,13 +1,14 @@ module github.com/go-git/go-git/v5 require ( - github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 // indirect github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 github.com/emirpasic/gods v1.12.0 github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect github.com/gliderlabs/ssh v0.2.2 + github.com/go-git/gcfg v1.5.0 github.com/go-git/go-billy/v5 v5.0.0 + github.com/go-git/go-git-fixtures/v4 v4.0.0 github.com/google/go-cmp v0.3.0 github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 github.com/jessevdk/go-flags v1.4.0 @@ -15,15 +16,11 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/pkg/errors v0.8.1 // indirect github.com/sergi/go-diff v1.1.0 - github.com/src-d/gcfg v1.4.0 github.com/xanzy/ssh-agent v0.2.1 golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 golang.org/x/net v0.0.0-20200301022130-244492dfa37a golang.org/x/text v0.3.2 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f - gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect - gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 - github.com/go-git/go-git/v5 v4.13.1 gopkg.in/warnings.v0 v0.1.2 // indirect ) @@ -4,7 +4,6 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -15,8 +14,14 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjr github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-git/gcfg v1.4.0 h1:+MzT7ImUasMEDSPwAGvAj2pFbN28BYzw5vM/4UZIIfE= +github.com/go-git/gcfg v1.4.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM= github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.0 h1:2CMMjgatjbdysXcvT23ctyFjkR2w4420flyGwGvDQ6E= +github.com/go-git/go-git-fixtures/v4 v4.0.0/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= @@ -28,7 +33,6 @@ github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -37,39 +41,29 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4= github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e h1:D5TXcfTk7xF7hvieo4QErS3qqCB4teTffacDWr7CI+0= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= @@ -77,19 +71,10 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg= -gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= -gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOAJK+LsJg= -gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= -github.com/go-git/go-git/v5 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE= -github.com/go-git/go-git/v5 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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) { diff --git a/plumbing/object/change_adaptor_test.go b/plumbing/object/change_adaptor_test.go index 6b718ff..b8dd5d1 100644 --- a/plumbing/object/change_adaptor_test.go +++ b/plumbing/object/change_adaptor_test.go @@ -11,8 +11,8 @@ import ( "github.com/go-git/go-git/v5/utils/merkletrie" "github.com/go-git/go-git/v5/utils/merkletrie/noder" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) type ChangeAdaptorSuite struct { @@ -22,7 +22,6 @@ type ChangeAdaptorSuite struct { } func (s *ChangeAdaptorSuite) SetUpSuite(c *C) { - s.Suite.SetUpSuite(c) s.Fixture = fixtures.Basic().One() sto := filesystem.NewStorage(s.Fixture.DotGit(), cache.NewObjectLRUDefault()) s.Storer = sto diff --git a/plumbing/object/change_test.go b/plumbing/object/change_test.go index 357cb67..2c1fe37 100644 --- a/plumbing/object/change_test.go +++ b/plumbing/object/change_test.go @@ -4,6 +4,7 @@ import ( "context" "sort" + 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/cache" "github.com/go-git/go-git/v5/plumbing/filemode" @@ -13,7 +14,6 @@ import ( "github.com/go-git/go-git/v5/utils/merkletrie" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) type ChangeSuite struct { @@ -23,7 +23,6 @@ type ChangeSuite struct { } func (s *ChangeSuite) SetUpSuite(c *C) { - s.Suite.SetUpSuite(c) s.Fixture = fixtures.ByURL("https://github.com/src-d/go-git.git"). ByTag(".git").One() sto := filesystem.NewStorage(s.Fixture.DotGit(), cache.NewObjectLRUDefault()) @@ -250,7 +249,6 @@ func (s *ChangeSuite) TestEmptyChangeFails(c *C) { // test reproducing bug #317 func (s *ChangeSuite) TestNoFileFilemodes(c *C) { - s.Suite.SetUpSuite(c) f := fixtures.ByURL("https://github.com/git-fixtures/submodule.git").One() sto := filesystem.NewStorage(f.DotGit(), cache.NewObjectLRUDefault()) diff --git a/plumbing/object/commit_stats_test.go b/plumbing/object/commit_stats_test.go index 953a9cb..bce2953 100644 --- a/plumbing/object/commit_stats_test.go +++ b/plumbing/object/commit_stats_test.go @@ -12,7 +12,7 @@ import ( "github.com/go-git/go-billy/v5/memfs" "github.com/go-git/go-billy/v5/util" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) type CommitStatsSuite struct { diff --git a/plumbing/object/commit_test.go b/plumbing/object/commit_test.go index d56d812..28a7a81 100644 --- a/plumbing/object/commit_test.go +++ b/plumbing/object/commit_test.go @@ -8,7 +8,7 @@ import ( "strings" "time" - 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/cache" diff --git a/plumbing/object/commit_walker_bfs_filtered_test.go b/plumbing/object/commit_walker_bfs_filtered_test.go index b7ee0bb..9ea7dc6 100644 --- a/plumbing/object/commit_walker_bfs_filtered_test.go +++ b/plumbing/object/commit_walker_bfs_filtered_test.go @@ -82,7 +82,7 @@ func not(filter CommitFilter) CommitFilter { // history, but e8d3ffab552895c19b9fcf7aa264d277cde33881, that is not reachable // from HEAD func (s *filterCommitIterSuite) TestFilterCommitIter(c *C) { - from := s.commit(c, s.Fixture.Head) + from := s.commit(c, plumbing.NewHash(s.Fixture.Head)) commits, err := commitsFromIter(NewFilterCommitIter(from, nil, nil)) c.Assert(err, IsNil) @@ -105,7 +105,7 @@ func (s *filterCommitIterSuite) TestFilterCommitIter(c *C) { // that matches the passed isValid filter; in this testcase, it was filtered out // all commits but one from history func (s *filterCommitIterSuite) TestFilterCommitIterWithValid(c *C) { - from := s.commit(c, s.Fixture.Head) + from := s.commit(c, plumbing.NewHash(s.Fixture.Head)) validIf := validIfCommit(plumbing.NewHash("35e85108805c84807bc66a02d91535e1e24b38b9")) commits, err := commitsFromIter(NewFilterCommitIter(from, &validIf, nil)) @@ -121,7 +121,7 @@ func (s *filterCommitIterSuite) TestFilterCommitIterWithValid(c *C) { // that matches the passed isValid filter; in this testcase, it was filtered out // only one commit from history func (s *filterCommitIterSuite) TestFilterCommitIterWithInvalid(c *C) { - from := s.commit(c, s.Fixture.Head) + from := s.commit(c, plumbing.NewHash(s.Fixture.Head)) validIf := validIfCommit(plumbing.NewHash("35e85108805c84807bc66a02d91535e1e24b38b9")) validIfNot := not(validIf) @@ -144,7 +144,7 @@ func (s *filterCommitIterSuite) TestFilterCommitIterWithInvalid(c *C) { // TestFilterCommitIterWithNoValidCommits asserts that FilterCommitIter returns // no commits if the passed isValid filter does not allow any commit func (s *filterCommitIterSuite) TestFilterCommitIterWithNoValidCommits(c *C) { - from := s.commit(c, s.Fixture.Head) + from := s.commit(c, plumbing.NewHash(s.Fixture.Head)) validIf := validIfCommit(plumbing.NewHash("THIS_COMMIT_DOES_NOT_EXIST")) commits, err := commitsFromIter(NewFilterCommitIter(from, &validIf, nil)) @@ -155,7 +155,7 @@ func (s *filterCommitIterSuite) TestFilterCommitIterWithNoValidCommits(c *C) { // TestFilterCommitIterWithStopAt asserts that FilterCommitIter returns only commits // are not beyond a isLimit filter func (s *filterCommitIterSuite) TestFilterCommitIterWithStopAt(c *C) { - from := s.commit(c, s.Fixture.Head) + from := s.commit(c, plumbing.NewHash(s.Fixture.Head)) stopAtRule := validIfCommit(plumbing.NewHash("a5b8b09e2f8fcb0bb99d3ccb0958157b40890d69")) commits, err := commitsFromIter(NewFilterCommitIter(from, nil, &stopAtRule)) @@ -177,7 +177,7 @@ func (s *filterCommitIterSuite) TestFilterCommitIterWithStopAt(c *C) { // TestFilterCommitIterWithStopAt asserts that FilterCommitIter works properly // with isValid and isLimit filters func (s *filterCommitIterSuite) TestFilterCommitIterWithInvalidAndStopAt(c *C) { - from := s.commit(c, s.Fixture.Head) + from := s.commit(c, plumbing.NewHash(s.Fixture.Head)) stopAtRule := validIfCommit(plumbing.NewHash("a5b8b09e2f8fcb0bb99d3ccb0958157b40890d69")) validIf := validIfCommit(plumbing.NewHash("35e85108805c84807bc66a02d91535e1e24b38b9")) @@ -224,7 +224,7 @@ func (s *filterCommitIterSuite) TestIteratorForEachCallbackReturn(c *C) { return nil } - from := s.commit(c, s.Fixture.Head) + from := s.commit(c, plumbing.NewHash(s.Fixture.Head)) iter := NewFilterCommitIter(from, nil, nil) err := iter.ForEach(cb) diff --git a/plumbing/object/commit_walker_test.go b/plumbing/object/commit_walker_test.go index 628adaf..c47d68b 100644 --- a/plumbing/object/commit_walker_test.go +++ b/plumbing/object/commit_walker_test.go @@ -13,7 +13,7 @@ type CommitWalkerSuite struct { var _ = Suite(&CommitWalkerSuite{}) func (s *CommitWalkerSuite) TestCommitPreIterator(c *C) { - commit := s.commit(c, s.Fixture.Head) + commit := s.commit(c, plumbing.NewHash(s.Fixture.Head)) var commits []*Commit NewCommitPreorderIter(commit, nil, nil).ForEach(func(c *Commit) error { @@ -39,7 +39,7 @@ func (s *CommitWalkerSuite) TestCommitPreIterator(c *C) { } func (s *CommitWalkerSuite) TestCommitPreIteratorWithIgnore(c *C) { - commit := s.commit(c, s.Fixture.Head) + commit := s.commit(c, plumbing.NewHash(s.Fixture.Head)) var commits []*Commit NewCommitPreorderIter(commit, nil, []plumbing.Hash{ @@ -61,7 +61,7 @@ func (s *CommitWalkerSuite) TestCommitPreIteratorWithIgnore(c *C) { } func (s *CommitWalkerSuite) TestCommitPreIteratorWithSeenExternal(c *C) { - commit := s.commit(c, s.Fixture.Head) + commit := s.commit(c, plumbing.NewHash(s.Fixture.Head)) var commits []*Commit seenExternal := map[plumbing.Hash]bool{ @@ -85,7 +85,7 @@ func (s *CommitWalkerSuite) TestCommitPreIteratorWithSeenExternal(c *C) { } func (s *CommitWalkerSuite) TestCommitPostIterator(c *C) { - commit := s.commit(c, s.Fixture.Head) + commit := s.commit(c, plumbing.NewHash(s.Fixture.Head)) var commits []*Commit NewCommitPostorderIter(commit, nil).ForEach(func(c *Commit) error { @@ -112,7 +112,7 @@ func (s *CommitWalkerSuite) TestCommitPostIterator(c *C) { } func (s *CommitWalkerSuite) TestCommitPostIteratorWithIgnore(c *C) { - commit := s.commit(c, s.Fixture.Head) + commit := s.commit(c, plumbing.NewHash(s.Fixture.Head)) var commits []*Commit NewCommitPostorderIter(commit, []plumbing.Hash{ @@ -134,7 +134,7 @@ func (s *CommitWalkerSuite) TestCommitPostIteratorWithIgnore(c *C) { } func (s *CommitWalkerSuite) TestCommitCTimeIterator(c *C) { - commit := s.commit(c, s.Fixture.Head) + commit := s.commit(c, plumbing.NewHash(s.Fixture.Head)) var commits []*Commit NewCommitIterCTime(commit, nil, nil).ForEach(func(c *Commit) error { @@ -160,7 +160,7 @@ func (s *CommitWalkerSuite) TestCommitCTimeIterator(c *C) { } func (s *CommitWalkerSuite) TestCommitCTimeIteratorWithIgnore(c *C) { - commit := s.commit(c, s.Fixture.Head) + commit := s.commit(c, plumbing.NewHash(s.Fixture.Head)) var commits []*Commit NewCommitIterCTime(commit, nil, []plumbing.Hash{ @@ -182,7 +182,7 @@ func (s *CommitWalkerSuite) TestCommitCTimeIteratorWithIgnore(c *C) { } func (s *CommitWalkerSuite) TestCommitBSFIterator(c *C) { - commit := s.commit(c, s.Fixture.Head) + commit := s.commit(c, plumbing.NewHash(s.Fixture.Head)) var commits []*Commit NewCommitIterBSF(commit, nil, nil).ForEach(func(c *Commit) error { @@ -208,7 +208,7 @@ func (s *CommitWalkerSuite) TestCommitBSFIterator(c *C) { } func (s *CommitWalkerSuite) TestCommitBSFIteratorWithIgnore(c *C) { - commit := s.commit(c, s.Fixture.Head) + commit := s.commit(c, plumbing.NewHash(s.Fixture.Head)) var commits []*Commit NewCommitIterBSF(commit, nil, []plumbing.Hash{ diff --git a/plumbing/object/commitgraph/commitnode_test.go b/plumbing/object/commitgraph/commitnode_test.go index 4f9a0b8..38d3bce 100644 --- a/plumbing/object/commitgraph/commitnode_test.go +++ b/plumbing/object/commitgraph/commitnode_test.go @@ -5,7 +5,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/cache"
"github.com/go-git/go-git/v5/plumbing/format/commitgraph"
diff --git a/plumbing/object/difftree_test.go b/plumbing/object/difftree_test.go index 699672b..04416c7 100644 --- a/plumbing/object/difftree_test.go +++ b/plumbing/object/difftree_test.go @@ -3,6 +3,7 @@ package object import ( "sort" + 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/cache" "github.com/go-git/go-git/v5/plumbing/filemode" @@ -13,7 +14,6 @@ import ( "github.com/go-git/go-git/v5/utils/merkletrie" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) type DiffTreeSuite struct { @@ -24,7 +24,6 @@ type DiffTreeSuite struct { } func (s *DiffTreeSuite) SetUpSuite(c *C) { - s.Suite.SetUpSuite(c) s.Fixture = fixtures.Basic().One() sto := filesystem.NewStorage(s.Fixture.DotGit(), cache.NewObjectLRUDefault()) s.Storer = sto diff --git a/plumbing/object/file_test.go b/plumbing/object/file_test.go index dce5e91..4dfd950 100644 --- a/plumbing/object/file_test.go +++ b/plumbing/object/file_test.go @@ -10,7 +10,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 FileSuite struct { diff --git a/plumbing/object/merge_base_test.go b/plumbing/object/merge_base_test.go index 7d239cb..2a40f6e 100644 --- a/plumbing/object/merge_base_test.go +++ b/plumbing/object/merge_base_test.go @@ -8,8 +8,8 @@ import ( "github.com/go-git/go-git/v5/plumbing/cache" "github.com/go-git/go-git/v5/storage/filesystem" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - fixtures "gopkg.in/src-d/go-git-fixtures.v3" ) func alphabeticSortCommits(commits []*Commit) { @@ -67,7 +67,6 @@ type mergeBaseSuite struct { } func (s *mergeBaseSuite) SetUpSuite(c *C) { - s.Suite.SetUpSuite(c) s.Fixture = fixtures.ByTag("merge-base").One() s.Storer = filesystem.NewStorage(s.Fixture.DotGit(), cache.NewObjectLRUDefault()) } diff --git a/plumbing/object/object_test.go b/plumbing/object/object_test.go index de5f78a..6c95eef 100644 --- a/plumbing/object/object_test.go +++ b/plumbing/object/object_test.go @@ -6,6 +6,7 @@ import ( "testing" "time" + 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/cache" "github.com/go-git/go-git/v5/plumbing/filemode" @@ -13,7 +14,6 @@ import ( "github.com/go-git/go-git/v5/storage/filesystem" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) func Test(t *testing.T) { TestingT(t) } @@ -25,7 +25,6 @@ type BaseObjectsSuite struct { } func (s *BaseObjectsSuite) SetUpSuite(c *C) { - s.Suite.SetUpSuite(c) s.Fixture = fixtures.Basic().One() storer := filesystem.NewStorage(s.Fixture.DotGit(), cache.NewObjectLRUDefault()) s.Storer = storer diff --git a/plumbing/object/patch_test.go b/plumbing/object/patch_test.go index b4bc1e8..d4b6cd6 100644 --- a/plumbing/object/patch_test.go +++ b/plumbing/object/patch_test.go @@ -2,7 +2,7 @@ package object import ( . "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/cache" "github.com/go-git/go-git/v5/storage/filesystem" diff --git a/plumbing/object/tag_test.go b/plumbing/object/tag_test.go index 8561112..e3f3dca 100644 --- a/plumbing/object/tag_test.go +++ b/plumbing/object/tag_test.go @@ -7,7 +7,7 @@ import ( "strings" "time" - 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/cache" "github.com/go-git/go-git/v5/storage/filesystem" diff --git a/plumbing/object/tree_test.go b/plumbing/object/tree_test.go index ab1a4f9..319caae 100644 --- a/plumbing/object/tree_test.go +++ b/plumbing/object/tree_test.go @@ -11,7 +11,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 TreeSuite struct { diff --git a/plumbing/revlist/revlist_test.go b/plumbing/revlist/revlist_test.go index 3b09630..a1ee504 100644 --- a/plumbing/revlist/revlist_test.go +++ b/plumbing/revlist/revlist_test.go @@ -9,8 +9,8 @@ import ( "github.com/go-git/go-git/v5/plumbing/storer" "github.com/go-git/go-git/v5/storage/filesystem" + 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) } @@ -51,7 +51,6 @@ const ( // * b029517 Initial commit func (s *RevListSuite) SetUpTest(c *C) { - s.Suite.SetUpSuite(c) sto := filesystem.NewStorage(fixtures.Basic().One().DotGit(), cache.NewObjectLRUDefault()) s.Storer = sto } 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) diff --git a/prune_test.go b/prune_test.go index 418c285..bd5168d 100644 --- a/prune_test.go +++ b/prune_test.go @@ -10,7 +10,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 PruneSuite struct { diff --git a/references_test.go b/references_test.go index 31715e6..7c26ce2 100644 --- a/references_test.go +++ b/references_test.go @@ -9,7 +9,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 ReferencesSuite struct { diff --git a/remote_test.go b/remote_test.go index 1e094b0..6766514 100644 --- a/remote_test.go +++ b/remote_test.go @@ -21,7 +21,7 @@ import ( "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" ) type RemoteSuite struct { diff --git a/repository_test.go b/repository_test.go index 8df8019..f13a755 100644 --- a/repository_test.go +++ b/repository_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - fixtures "gopkg.in/src-d/go-git-fixtures.v3" + fixtures "github.com/go-git/go-git-fixtures/v4" "golang.org/x/crypto/openpgp" "golang.org/x/crypto/openpgp/armor" @@ -2844,10 +2844,6 @@ func (s *RepositorySuite) TestBrokenMultipleShallowFetch(c *C) { } func BenchmarkObjects(b *testing.B) { - if err := fixtures.Init(); err != nil { - b.Fatal(err) - } - defer func() { if err := fixtures.Clean(); err != nil { b.Fatal(err) @@ -2855,7 +2851,7 @@ func BenchmarkObjects(b *testing.B) { }() for _, f := range fixtures.ByTag("packfile") { - if f.DotGitHash == plumbing.ZeroHash { + if f.DotGitHash == "" { continue } diff --git a/storage/filesystem/config_test.go b/storage/filesystem/config_test.go index 89d4210..fe84698 100644 --- a/storage/filesystem/config_test.go +++ b/storage/filesystem/config_test.go @@ -9,7 +9,7 @@ import ( "github.com/go-git/go-billy/v5/osfs" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) type ConfigSuite struct { diff --git a/storage/filesystem/dotgit/dotgit_test.go b/storage/filesystem/dotgit/dotgit_test.go index 87b702d..cf81c23 100644 --- a/storage/filesystem/dotgit/dotgit_test.go +++ b/storage/filesystem/dotgit/dotgit_test.go @@ -13,8 +13,8 @@ import ( "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-billy/v5/osfs" + 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) } @@ -167,7 +167,6 @@ func (s *SuiteDotGit) TestRefsFromReferenceFile(c *C) { } func BenchmarkRefMultipleTimes(b *testing.B) { - fixtures.Init() fs := fixtures.Basic().ByTag(".git").One().DotGit() refname := plumbing.ReferenceName("refs/remotes/origin/branch") @@ -456,7 +455,7 @@ func testObjectPacks(c *C, fs billy.Filesystem, dir *DotGit, f *fixtures.Fixture hashes, err := dir.ObjectPacks() c.Assert(err, IsNil) c.Assert(hashes, HasLen, 1) - c.Assert(hashes[0], Equals, f.PackfileHash) + c.Assert(hashes[0], Equals, plumbing.NewHash(f.PackfileHash)) // Make sure that a random file in the pack directory doesn't // break everything. @@ -481,7 +480,7 @@ func (s *SuiteDotGit) TestObjectPack(c *C) { fs := f.DotGit() dir := New(fs) - pack, err := dir.ObjectPack(f.PackfileHash) + pack, err := dir.ObjectPack(plumbing.NewHash(f.PackfileHash)) c.Assert(err, IsNil) c.Assert(filepath.Ext(pack.Name()), Equals, ".pack") } @@ -491,14 +490,14 @@ func (s *SuiteDotGit) TestObjectPackWithKeepDescriptors(c *C) { fs := f.DotGit() dir := NewWithOptions(fs, Options{KeepDescriptors: true}) - pack, err := dir.ObjectPack(f.PackfileHash) + pack, err := dir.ObjectPack(plumbing.NewHash(f.PackfileHash)) c.Assert(err, IsNil) c.Assert(filepath.Ext(pack.Name()), Equals, ".pack") // Move to an specific offset pack.Seek(42, os.SEEK_SET) - pack2, err := dir.ObjectPack(f.PackfileHash) + pack2, err := dir.ObjectPack(plumbing.NewHash(f.PackfileHash)) c.Assert(err, IsNil) // If the file is the same the offset should be the same @@ -509,7 +508,7 @@ func (s *SuiteDotGit) TestObjectPackWithKeepDescriptors(c *C) { err = dir.Close() c.Assert(err, IsNil) - pack2, err = dir.ObjectPack(f.PackfileHash) + pack2, err = dir.ObjectPack(plumbing.NewHash(f.PackfileHash)) c.Assert(err, IsNil) // If the file is opened again its offset should be 0 @@ -530,7 +529,7 @@ func (s *SuiteDotGit) TestObjectPackIdx(c *C) { fs := f.DotGit() dir := New(fs) - idx, err := dir.ObjectPackIdx(f.PackfileHash) + idx, err := dir.ObjectPackIdx(plumbing.NewHash(f.PackfileHash)) c.Assert(err, IsNil) c.Assert(filepath.Ext(idx.Name()), Equals, ".idx") c.Assert(idx.Close(), IsNil) diff --git a/storage/filesystem/dotgit/writers_test.go b/storage/filesystem/dotgit/writers_test.go index 8d3b797..246d310 100644 --- a/storage/filesystem/dotgit/writers_test.go +++ b/storage/filesystem/dotgit/writers_test.go @@ -14,7 +14,7 @@ import ( "github.com/go-git/go-billy/v5/osfs" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) func (s *SuiteDotGit) TestNewObjectPack(c *C) { diff --git a/storage/filesystem/object_test.go b/storage/filesystem/object_test.go index f9a6a76..6c35129 100644 --- a/storage/filesystem/object_test.go +++ b/storage/filesystem/object_test.go @@ -12,8 +12,8 @@ import ( "github.com/go-git/go-git/v5/plumbing/cache" "github.com/go-git/go-git/v5/storage/filesystem/dotgit" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) type FsSuite struct { @@ -248,7 +248,7 @@ func (s *FsSuite) TestPackfileReindex(c *C) { packFixture := fixtures.ByTag("packfile").ByTag("standalone").One() packFile := packFixture.Packfile() idxFile := packFixture.Idx() - packFilename := packFixture.PackfileHash.String() + packFilename := packFixture.PackfileHash testObjectHash := plumbing.NewHash("a771b1e94141480861332fd0e4684d33071306c6") // this is an object we know exists in the standalone packfile fixtures.ByTag(".git").Test(c, func(f *fixtures.Fixture) { fs := f.DotGit() @@ -333,10 +333,6 @@ func (s *FsSuite) TestGetFromObjectFileSharedCache(c *C) { } func BenchmarkPackfileIter(b *testing.B) { - if err := fixtures.Init(); err != nil { - b.Fatal(err) - } - defer func() { if err := fixtures.Clean(); err != nil { b.Fatal(err) @@ -389,10 +385,6 @@ func BenchmarkPackfileIter(b *testing.B) { } func BenchmarkPackfileIterReadContent(b *testing.B) { - if err := fixtures.Init(); err != nil { - b.Fatal(err) - } - defer func() { if err := fixtures.Clean(); err != nil { b.Fatal(err) @@ -455,10 +447,6 @@ func BenchmarkPackfileIterReadContent(b *testing.B) { } func BenchmarkGetObjectFromPackfile(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/storage/filesystem/storage_test.go b/storage/filesystem/storage_test.go index 2c7c690..20eead0 100644 --- a/storage/filesystem/storage_test.go +++ b/storage/filesystem/storage_test.go @@ -39,7 +39,6 @@ func setUpTest(s *StorageSuite, c *C, storage *Storage) { var _ storer.PackfileWriter = storage s.BaseStorageSuite = test.NewBaseStorageSuite(storage) - s.BaseStorageSuite.SetUpTest(c) } func (s *StorageSuite) TestFilesystem(c *C) { diff --git a/storage/memory/storage_test.go b/storage/memory/storage_test.go index 85c7859..a634d5d 100644 --- a/storage/memory/storage_test.go +++ b/storage/memory/storage_test.go @@ -3,8 +3,8 @@ package memory import ( "testing" - . "gopkg.in/check.v1" "github.com/go-git/go-git/v5/storage/test" + . "gopkg.in/check.v1" ) func Test(t *testing.T) { TestingT(t) } @@ -17,5 +17,4 @@ var _ = Suite(&StorageSuite{}) func (s *StorageSuite) SetUpTest(c *C) { s.BaseStorageSuite = test.NewBaseStorageSuite(NewStorage()) - s.BaseStorageSuite.SetUpTest(c) } diff --git a/storage/test/storage_suite.go b/storage/test/storage_suite.go index a483a79..a646fad 100644 --- a/storage/test/storage_suite.go +++ b/storage/test/storage_suite.go @@ -13,8 +13,8 @@ import ( "github.com/go-git/go-git/v5/plumbing/storer" "github.com/go-git/go-git/v5/storage" + fixtures "github.com/go-git/go-git-fixtures/v4" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" ) type Storer interface { @@ -65,10 +65,6 @@ func NewBaseStorageSuite(s Storer) BaseStorageSuite { }} } -func (s *BaseStorageSuite) SetUpTest(c *C) { - c.Assert(fixtures.Init(), IsNil) -} - func (s *BaseStorageSuite) TearDownTest(c *C) { c.Assert(fixtures.Clean(), IsNil) } diff --git a/storage/transactional/storage_test.go b/storage/transactional/storage_test.go index 41d656b..c620bdc 100644 --- a/storage/transactional/storage_test.go +++ b/storage/transactional/storage_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/go-git/go-billy/v5/memfs" - . "gopkg.in/check.v1" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/cache" "github.com/go-git/go-git/v5/plumbing/storer" @@ -12,6 +11,7 @@ import ( "github.com/go-git/go-git/v5/storage/filesystem" "github.com/go-git/go-git/v5/storage/memory" "github.com/go-git/go-git/v5/storage/test" + . "gopkg.in/check.v1" ) func Test(t *testing.T) { TestingT(t) } @@ -39,7 +39,6 @@ func (s *StorageSuite) SetUpTest(c *C) { temporal := s.temporal() s.BaseStorageSuite = test.NewBaseStorageSuite(NewStorage(base, temporal)) - s.BaseStorageSuite.SetUpTest(c) } func (s *StorageSuite) TestCommit(c *C) { diff --git a/submodule_test.go b/submodule_test.go index 335786b..3d81965 100644 --- a/submodule_test.go +++ b/submodule_test.go @@ -10,7 +10,7 @@ import ( "github.com/go-git/go-git/v5/plumbing" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) type SubmoduleSuite struct { diff --git a/worktree_test.go b/worktree_test.go index 1d8b7d3..1485189 100644 --- a/worktree_test.go +++ b/worktree_test.go @@ -25,7 +25,7 @@ import ( "github.com/go-git/go-billy/v5/util" "golang.org/x/text/unicode/norm" . "gopkg.in/check.v1" - "gopkg.in/src-d/go-git-fixtures.v3" + "github.com/go-git/go-git-fixtures/v4" ) type WorktreeSuite struct { |