aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-02-21 18:55:19 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-02-21 18:55:19 +0100
commit4e4a85703c5ce5384a58e85bafc58cc235793ab8 (patch)
tree747fcaf5786f830cc3618a26d2699f58cde7c191
parentdc322326e26d360cfc6ca6921f48265b1f7a4453 (diff)
downloadgo-git-4e4a85703c5ce5384a58e85bafc58cc235793ab8.tar.gz
*: update tests to meet new submodule fixture
-rw-r--r--common_test.go12
-rw-r--r--plumbing/object/file_test.go5
-rw-r--r--plumbing/object/tree_test.go5
3 files changed, 6 insertions, 16 deletions
diff --git a/common_test.go b/common_test.go
index 5aabd06..98c81b1 100644
--- a/common_test.go
+++ b/common_test.go
@@ -7,7 +7,6 @@ import (
"srcd.works/go-git.v4/plumbing"
"srcd.works/go-git.v4/plumbing/format/packfile"
"srcd.works/go-git.v4/plumbing/transport"
- "srcd.works/go-git.v4/plumbing/transport/client"
"srcd.works/go-git.v4/storage/filesystem"
"srcd.works/go-git.v4/storage/memory"
@@ -29,7 +28,6 @@ type BaseSuite struct {
func (s *BaseSuite) SetUpSuite(c *C) {
s.Suite.SetUpSuite(c)
- s.installMockProtocol()
s.buildBasicRepository(c)
s.cache = make(map[string]*Repository, 0)
@@ -37,7 +35,6 @@ func (s *BaseSuite) SetUpSuite(c *C) {
func (s *BaseSuite) TearDownSuite(c *C) {
s.Suite.TearDownSuite(c)
- s.uninstallMockProtocol()
}
func (s *BaseSuite) buildBasicRepository(c *C) {
@@ -92,15 +89,6 @@ func (s *BaseSuite) NewRepositoryFromPackfile(f *fixtures.Fixture) *Repository {
return r
}
-func (s *BaseSuite) installMockProtocol() {
- s.backupProtocol = client.Protocols["https"]
- client.InstallProtocol("https", nil)
-}
-
-func (s *BaseSuite) uninstallMockProtocol() {
- client.InstallProtocol("https", s.backupProtocol)
-}
-
func (s *BaseSuite) GetBasicLocalRepositoryURL() string {
fixture := fixtures.Basic().One()
return s.GetLocalRepositoryURL(fixture)
diff --git a/plumbing/object/file_test.go b/plumbing/object/file_test.go
index ff01c9f..c482541 100644
--- a/plumbing/object/file_test.go
+++ b/plumbing/object/file_test.go
@@ -254,7 +254,7 @@ func (s *FileSuite) TestFileIterSubmodule(c *C) {
c.Assert(err, IsNil)
- hash := plumbing.NewHash("a692ec699bff9117c1ed91752afbb7d9d272ebef")
+ hash := plumbing.NewHash("b685400c1f9316f350965a5993d350bc746b0bf4")
commit, err := GetCommit(st, hash)
c.Assert(err, IsNil)
@@ -263,6 +263,7 @@ func (s *FileSuite) TestFileIterSubmodule(c *C) {
expected := []string{
".gitmodules",
+ "README.md",
}
var count int
@@ -273,5 +274,5 @@ func (s *FileSuite) TestFileIterSubmodule(c *C) {
return nil
})
- c.Assert(count, Equals, 1)
+ c.Assert(count, Equals, 2)
}
diff --git a/plumbing/object/tree_test.go b/plumbing/object/tree_test.go
index 8ea31bb..81fbdec 100644
--- a/plumbing/object/tree_test.go
+++ b/plumbing/object/tree_test.go
@@ -270,7 +270,7 @@ func (s *TreeSuite) TestTreeWalkerNextSubmodule(c *C) {
st, err := filesystem.NewStorage(dotgit)
c.Assert(err, IsNil)
- hash := plumbing.NewHash("a692ec699bff9117c1ed91752afbb7d9d272ebef")
+ hash := plumbing.NewHash("b685400c1f9316f350965a5993d350bc746b0bf4")
commit, err := GetCommit(st, hash)
c.Assert(err, IsNil)
@@ -279,6 +279,7 @@ func (s *TreeSuite) TestTreeWalkerNextSubmodule(c *C) {
expected := []string{
".gitmodules",
+ "README.md",
"basic",
"itself",
}
@@ -300,7 +301,7 @@ func (s *TreeSuite) TestTreeWalkerNextSubmodule(c *C) {
count++
}
- c.Assert(count, Equals, 3)
+ c.Assert(count, Equals, 4)
}
var treeWalkerExpects = []struct {