Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 4e4a857

Browse files
committed
*: update tests to meet new submodule fixture
1 parent dc32232 commit 4e4a857

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

common_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"srcd.works/go-git.v4/plumbing"
88
"srcd.works/go-git.v4/plumbing/format/packfile"
99
"srcd.works/go-git.v4/plumbing/transport"
10-
"srcd.works/go-git.v4/plumbing/transport/client"
1110
"srcd.works/go-git.v4/storage/filesystem"
1211
"srcd.works/go-git.v4/storage/memory"
1312

@@ -29,15 +28,13 @@ type BaseSuite struct {
2928

3029
func (s *BaseSuite) SetUpSuite(c *C) {
3130
s.Suite.SetUpSuite(c)
32-
s.installMockProtocol()
3331
s.buildBasicRepository(c)
3432

3533
s.cache = make(map[string]*Repository, 0)
3634
}
3735

3836
func (s *BaseSuite) TearDownSuite(c *C) {
3937
s.Suite.TearDownSuite(c)
40-
s.uninstallMockProtocol()
4138
}
4239

4340
func (s *BaseSuite) buildBasicRepository(c *C) {
@@ -92,15 +89,6 @@ func (s *BaseSuite) NewRepositoryFromPackfile(f *fixtures.Fixture) *Repository {
9289
return r
9390
}
9491

95-
func (s *BaseSuite) installMockProtocol() {
96-
s.backupProtocol = client.Protocols["https"]
97-
client.InstallProtocol("https", nil)
98-
}
99-
100-
func (s *BaseSuite) uninstallMockProtocol() {
101-
client.InstallProtocol("https", s.backupProtocol)
102-
}
103-
10492
func (s *BaseSuite) GetBasicLocalRepositoryURL() string {
10593
fixture := fixtures.Basic().One()
10694
return s.GetLocalRepositoryURL(fixture)

plumbing/object/file_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ func (s *FileSuite) TestFileIterSubmodule(c *C) {
254254

255255
c.Assert(err, IsNil)
256256

257-
hash := plumbing.NewHash("a692ec699bff9117c1ed91752afbb7d9d272ebef")
257+
hash := plumbing.NewHash("b685400c1f9316f350965a5993d350bc746b0bf4")
258258
commit, err := GetCommit(st, hash)
259259
c.Assert(err, IsNil)
260260

@@ -263,6 +263,7 @@ func (s *FileSuite) TestFileIterSubmodule(c *C) {
263263

264264
expected := []string{
265265
".gitmodules",
266+
"README.md",
266267
}
267268

268269
var count int
@@ -273,5 +274,5 @@ func (s *FileSuite) TestFileIterSubmodule(c *C) {
273274
return nil
274275
})
275276

276-
c.Assert(count, Equals, 1)
277+
c.Assert(count, Equals, 2)
277278
}

plumbing/object/tree_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func (s *TreeSuite) TestTreeWalkerNextSubmodule(c *C) {
270270
st, err := filesystem.NewStorage(dotgit)
271271
c.Assert(err, IsNil)
272272

273-
hash := plumbing.NewHash("a692ec699bff9117c1ed91752afbb7d9d272ebef")
273+
hash := plumbing.NewHash("b685400c1f9316f350965a5993d350bc746b0bf4")
274274
commit, err := GetCommit(st, hash)
275275
c.Assert(err, IsNil)
276276

@@ -279,6 +279,7 @@ func (s *TreeSuite) TestTreeWalkerNextSubmodule(c *C) {
279279

280280
expected := []string{
281281
".gitmodules",
282+
"README.md",
282283
"basic",
283284
"itself",
284285
}
@@ -300,7 +301,7 @@ func (s *TreeSuite) TestTreeWalkerNextSubmodule(c *C) {
300301
count++
301302
}
302303

303-
c.Assert(count, Equals, 3)
304+
c.Assert(count, Equals, 4)
304305
}
305306

306307
var treeWalkerExpects = []struct {

0 commit comments

Comments
 (0)