Skip to content

Commit 2637279

Browse files
committed
*: migration from go-git-fixtures/v4 and go-git/gcfg
1 parent 2bdfd91 commit 2637279

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+115
-184
lines changed

blame_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"github.com/go-git/go-git/v5/plumbing/object"
66

77
. "gopkg.in/check.v1"
8-
"gopkg.in/src-d/go-git-fixtures.v3"
8+
"github.com/go-git/go-git-fixtures/v4"
99
)
1010

1111
type BlameSuite struct {

common_test.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"github.com/go-git/go-billy/v5"
1414
"github.com/go-git/go-billy/v5/memfs"
1515
"github.com/go-git/go-billy/v5/util"
16+
fixtures "github.com/go-git/go-git-fixtures/v4"
1617
. "gopkg.in/check.v1"
17-
"gopkg.in/src-d/go-git-fixtures.v3"
1818
)
1919

2020
func Test(t *testing.T) { TestingT(t) }
@@ -28,7 +28,6 @@ type BaseSuite struct {
2828
}
2929

3030
func (s *BaseSuite) SetUpSuite(c *C) {
31-
s.Suite.SetUpSuite(c)
3231
s.buildBasicRepository(c)
3332

3433
s.cache = make(map[string]*Repository)
@@ -99,7 +98,7 @@ func (s *BaseSuite) NewRepositoryWithEmptyWorktree(f *fixtures.Fixture) *Reposit
9998
}
10099

101100
func (s *BaseSuite) NewRepositoryFromPackfile(f *fixtures.Fixture) *Repository {
102-
h := f.PackfileHash.String()
101+
h := f.PackfileHash
103102
if r, ok := s.cache[h]; ok {
104103
return r
105104
}
@@ -112,7 +111,7 @@ func (s *BaseSuite) NewRepositoryFromPackfile(f *fixtures.Fixture) *Repository {
112111
panic(err)
113112
}
114113

115-
storer.SetReference(plumbing.NewHashReference(plumbing.HEAD, f.Head))
114+
storer.SetReference(plumbing.NewHashReference(plumbing.HEAD, plumbing.NewHash(f.Head)))
116115

117116
r, err := Open(storer, memfs.New())
118117
if err != nil {

go.mod

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
module github.com/go-git/go-git/v5
22

33
require (
4-
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 // indirect
54
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect
65
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
76
github.com/emirpasic/gods v1.12.0
87
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
98
github.com/gliderlabs/ssh v0.2.2
9+
github.com/go-git/gcfg v1.5.0
1010
github.com/go-git/go-billy/v5 v5.0.0
11+
github.com/go-git/go-git-fixtures/v4 v4.0.0
1112
github.com/google/go-cmp v0.3.0
1213
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
1314
github.com/jessevdk/go-flags v1.4.0
1415
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd
1516
github.com/mitchellh/go-homedir v1.1.0
1617
github.com/pkg/errors v0.8.1 // indirect
1718
github.com/sergi/go-diff v1.1.0
18-
github.com/src-d/gcfg v1.4.0
1919
github.com/xanzy/ssh-agent v0.2.1
2020
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
2121
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
2222
golang.org/x/text v0.3.2
2323
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f
24-
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
25-
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0
26-
github.com/go-git/go-git/v5 v4.13.1
2724
gopkg.in/warnings.v0 v0.1.2 // indirect
2825
)
2926

go.sum

+6-21
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo
44
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
55
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
66
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
7-
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
87
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
98
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
109
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
1514
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
1615
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
1716
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
17+
github.com/go-git/gcfg v1.4.0 h1:+MzT7ImUasMEDSPwAGvAj2pFbN28BYzw5vM/4UZIIfE=
18+
github.com/go-git/gcfg v1.4.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
19+
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
20+
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
1821
github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM=
1922
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
23+
github.com/go-git/go-git-fixtures/v4 v4.0.0 h1:2CMMjgatjbdysXcvT23ctyFjkR2w4420flyGwGvDQ6E=
24+
github.com/go-git/go-git-fixtures/v4 v4.0.0/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
2025
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
2126
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
2227
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
2833
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
2934
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
3035
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
31-
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
3236
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
3337
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
3438
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -37,59 +41,40 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG
3741
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
3842
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
3943
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
40-
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
4144
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
4245
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
4346
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4447
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
45-
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
4648
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
4749
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
4850
github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4=
4951
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI=
5052
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
51-
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
52-
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
5353
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
5454
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
5555
github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=
5656
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
5757
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
5858
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
59-
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
6059
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM=
6160
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
6261
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
63-
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
64-
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
6562
golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0=
6663
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
67-
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
6864
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
6965
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
7066
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
71-
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e h1:D5TXcfTk7xF7hvieo4QErS3qqCB4teTffacDWr7CI+0=
72-
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7367
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
7468
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7569
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
7670
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
7771
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
7872
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
7973
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
80-
golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
8174
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
82-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
83-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
8475
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
8576
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
8677
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
87-
gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg=
88-
gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98=
89-
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOAJK+LsJg=
90-
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g=
91-
github.com/go-git/go-git/v5 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE=
92-
github.com/go-git/go-git/v5 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8=
9378
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
9479
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
9580
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

plumbing/format/commitgraph/commitgraph_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"testing"
88

99
. "gopkg.in/check.v1"
10-
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
10+
fixtures "github.com/go-git/go-git-fixtures/v4"
1111
"github.com/go-git/go-git/v5/plumbing"
1212
"github.com/go-git/go-git/v5/plumbing/format/commitgraph"
1313
)

plumbing/format/config/decoder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package config
33
import (
44
"io"
55

6-
"github.com/src-d/gcfg"
6+
"github.com/go-git/gcfg"
77
)
88

99
// A Decoder reads and decodes config files from an input stream.

plumbing/format/idxfile/decoder_test.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"github.com/go-git/go-git/v5/plumbing"
1212
. "github.com/go-git/go-git/v5/plumbing/format/idxfile"
1313

14+
fixtures "github.com/go-git/go-git-fixtures/v4"
1415
. "gopkg.in/check.v1"
15-
"gopkg.in/src-d/go-git-fixtures.v3"
1616
)
1717

1818
func Test(t *testing.T) { TestingT(t) }
@@ -48,7 +48,7 @@ func (s *IdxfileSuite) TestDecode(c *C) {
4848
c.Assert(crc32, Equals, uint32(3645019190))
4949

5050
c.Assert(fmt.Sprintf("%x", idx.IdxChecksum), Equals, "fb794f1ec720b9bc8e43257451bd99c4be6fa1c9")
51-
c.Assert(fmt.Sprintf("%x", idx.PackfileChecksum), Equals, f.PackfileHash.String())
51+
c.Assert(fmt.Sprintf("%x", idx.PackfileChecksum), Equals, f.PackfileHash)
5252
}
5353

5454
func (s *IdxfileSuite) TestDecode64bitsOffsets(c *C) {
@@ -118,10 +118,6 @@ ch2xUA==
118118
`
119119

120120
func BenchmarkDecode(b *testing.B) {
121-
if err := fixtures.Init(); err != nil {
122-
b.Errorf("unexpected error initializing fixtures: %s", err)
123-
}
124-
125121
f := fixtures.Basic().One()
126122
fixture, err := ioutil.ReadAll(f.Idx())
127123
if err != nil {

plumbing/format/idxfile/encoder_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
. "github.com/go-git/go-git/v5/plumbing/format/idxfile"
88

99
. "gopkg.in/check.v1"
10-
"gopkg.in/src-d/go-git-fixtures.v3"
10+
"github.com/go-git/go-git-fixtures/v4"
1111
)
1212

1313
func (s *IdxfileSuite) TestDecodeEncode(c *C) {

plumbing/format/idxfile/idxfile_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/go-git/go-git/v5/plumbing/format/idxfile"
1212

1313
. "gopkg.in/check.v1"
14-
"gopkg.in/src-d/go-git-fixtures.v3"
14+
"github.com/go-git/go-git-fixtures/v4"
1515
)
1616

1717
func BenchmarkFindOffset(b *testing.B) {

plumbing/format/idxfile/writer_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/go-git/go-git/v5/plumbing/format/packfile"
1111

1212
. "gopkg.in/check.v1"
13-
"gopkg.in/src-d/go-git-fixtures.v3"
13+
"github.com/go-git/go-git-fixtures/v4"
1414
)
1515

1616
type WriterSuite struct {

plumbing/format/index/decoder_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/go-git/go-git/v5/plumbing/filemode"
88

99
. "gopkg.in/check.v1"
10-
"gopkg.in/src-d/go-git-fixtures.v3"
10+
"github.com/go-git/go-git-fixtures/v4"
1111
)
1212

1313
func Test(t *testing.T) { TestingT(t) }

plumbing/format/packfile/encoder_advanced_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/go-git/go-git/v5/storage/filesystem"
1616

1717
. "gopkg.in/check.v1"
18-
"gopkg.in/src-d/go-git-fixtures.v3"
18+
"github.com/go-git/go-git-fixtures/v4"
1919
)
2020

2121
type EncoderAdvancedSuite struct {

plumbing/format/packfile/encoder_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/go-git/go-git/v5/storage/memory"
1212

1313
. "gopkg.in/check.v1"
14-
"gopkg.in/src-d/go-git-fixtures.v3"
14+
"github.com/go-git/go-git-fixtures/v4"
1515
)
1616

1717
type EncoderSuite struct {

plumbing/format/packfile/packfile_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import (
55
"math"
66

77
"github.com/go-git/go-billy/v5/osfs"
8-
. "gopkg.in/check.v1"
9-
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
8+
fixtures "github.com/go-git/go-git-fixtures/v4"
109
"github.com/go-git/go-git/v5/plumbing"
1110
"github.com/go-git/go-git/v5/plumbing/format/idxfile"
1211
"github.com/go-git/go-git/v5/plumbing/format/packfile"
1312
"github.com/go-git/go-git/v5/plumbing/storer"
13+
. "gopkg.in/check.v1"
1414
)
1515

1616
type PackfileSuite struct {
@@ -49,7 +49,7 @@ func (s *PackfileSuite) TestGetByOffset(c *C) {
4949
func (s *PackfileSuite) TestID(c *C) {
5050
id, err := s.p.ID()
5151
c.Assert(err, IsNil)
52-
c.Assert(id, Equals, s.f.PackfileHash)
52+
c.Assert(id.String(), Equals, s.f.PackfileHash)
5353
}
5454

5555
func (s *PackfileSuite) TestGetAll(c *C) {
@@ -297,7 +297,7 @@ func (s *PackfileSuite) TestSize(c *C) {
297297
c.Assert(size, Equals, int64(76110))
298298

299299
// Get the size of the root commit, which is delta-encoded.
300-
offset, err = packfile.FindOffset(f.Head)
300+
offset, err = packfile.FindOffset(plumbing.NewHash(f.Head))
301301
c.Assert(err, IsNil)
302302
size, err = packfile.GetSizeByOffset(offset)
303303
c.Assert(err, IsNil)

plumbing/format/packfile/parser_test.go

+3-11
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"github.com/go-git/go-git/v5/plumbing/format/packfile"
1010
"github.com/go-git/go-git/v5/plumbing/storer"
1111

12+
fixtures "github.com/go-git/go-git-fixtures/v4"
1213
. "gopkg.in/check.v1"
13-
"gopkg.in/src-d/go-git-fixtures.v3"
1414
)
1515

1616
type ParserSuite struct {
@@ -106,7 +106,7 @@ func (s *ParserSuite) TestThinPack(c *C) {
106106
w.Close()
107107

108108
// Check that the test object that will come with our thin pack is *not* in the repo
109-
_, err = fs.Storer.EncodedObject(plumbing.CommitObject, thinpack.Head)
109+
_, err = fs.Storer.EncodedObject(plumbing.CommitObject, plumbing.NewHash(thinpack.Head))
110110
c.Assert(err, Equals, plumbing.ErrObjectNotFound)
111111

112112
// Now unpack the thin pack:
@@ -119,7 +119,7 @@ func (s *ParserSuite) TestThinPack(c *C) {
119119
c.Assert(h, Equals, plumbing.NewHash("1288734cbe0b95892e663221d94b95de1f5d7be8"))
120120

121121
// Check that our test object is now accessible
122-
_, err = fs.Storer.EncodedObject(plumbing.CommitObject, thinpack.Head)
122+
_, err = fs.Storer.EncodedObject(plumbing.CommitObject, plumbing.NewHash(thinpack.Head))
123123
c.Assert(err, IsNil)
124124

125125
}
@@ -192,10 +192,6 @@ func (t *testObserver) put(pos int64, o observerObject) {
192192
}
193193

194194
func BenchmarkParse(b *testing.B) {
195-
if err := fixtures.Init(); err != nil {
196-
b.Fatal(err)
197-
}
198-
199195
defer func() {
200196
if err := fixtures.Clean(); err != nil {
201197
b.Fatal(err)
@@ -220,10 +216,6 @@ func BenchmarkParse(b *testing.B) {
220216
}
221217

222218
func BenchmarkParseBasic(b *testing.B) {
223-
if err := fixtures.Init(); err != nil {
224-
b.Fatal(err)
225-
}
226-
227219
defer func() {
228220
if err := fixtures.Clean(); err != nil {
229221
b.Fatal(err)

plumbing/format/packfile/scanner_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"bytes"
55
"io"
66

7+
fixtures "github.com/go-git/go-git-fixtures/v4"
78
"github.com/go-git/go-git/v5/plumbing"
89

910
. "gopkg.in/check.v1"
10-
"gopkg.in/src-d/go-git-fixtures.v3"
1111
)
1212

1313
type ScannerSuite struct {
@@ -93,7 +93,7 @@ func (s *ScannerSuite) TestNextObjectHeaderWithOutReadObject(c *C) {
9393

9494
n, err := p.Checksum()
9595
c.Assert(err, IsNil)
96-
c.Assert(n, Equals, f.PackfileHash)
96+
c.Assert(n.String(), Equals, f.PackfileHash)
9797
}
9898

9999
func (s *ScannerSuite) TestNextObjectHeaderWithOutReadObjectNonSeekable(c *C) {
@@ -115,7 +115,7 @@ func (s *ScannerSuite) TestNextObjectHeaderWithOutReadObjectNonSeekable(c *C) {
115115

116116
n, err := p.Checksum()
117117
c.Assert(err, IsNil)
118-
c.Assert(n, Equals, f.PackfileHash)
118+
c.Assert(n.String(), Equals, f.PackfileHash)
119119
}
120120

121121
func (s *ScannerSuite) TestSeekObjectHeader(c *C) {

0 commit comments

Comments
 (0)