aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-21 01:07:15 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-21 01:07:15 +0200
commitb32e92d013f6fe0d97f094c4b1991100d568f980 (patch)
treec80e847e3409fe0303a3ebabdf3e2a01c45b37f3 /repository_test.go
parentc9f0c29f423f9bb26f32d6e8c7098f275171afb9 (diff)
downloadgo-git-b32e92d013f6fe0d97f094c4b1991100d568f980.tar.gz
remote and repository base on ConfigStore
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go25
1 files changed, 12 insertions, 13 deletions
diff --git a/repository_test.go b/repository_test.go
index 2539a0b..462fbcf 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -70,8 +70,6 @@ func (s *RepositorySuite) TestClone(c *C) {
r, err := NewMemoryRepository()
c.Assert(err, IsNil)
- c.Assert(r.Remotes, HasLen, 0)
-
head, err := r.Head()
c.Assert(err, Equals, core.ErrReferenceNotFound)
c.Assert(head, IsNil)
@@ -81,8 +79,10 @@ func (s *RepositorySuite) TestClone(c *C) {
})
c.Assert(err, IsNil)
- c.Assert(r.Remotes, HasLen, 1)
- c.Assert(r.Remotes[DefaultRemoteName], NotNil)
+
+ remotes, err := r.Remotes()
+ c.Assert(err, IsNil)
+ c.Assert(remotes, HasLen, 1)
head, err = r.Ref(core.HEAD, false)
c.Assert(err, IsNil)
@@ -112,8 +112,6 @@ func (s *RepositorySuite) TestCloneSingleBranchAndNonHEAD(c *C) {
r, err := NewMemoryRepository()
c.Assert(err, IsNil)
- c.Assert(r.Remotes, HasLen, 0)
-
head, err := r.Head()
c.Assert(err, Equals, core.ErrReferenceNotFound)
c.Assert(head, IsNil)
@@ -125,8 +123,10 @@ func (s *RepositorySuite) TestCloneSingleBranchAndNonHEAD(c *C) {
})
c.Assert(err, IsNil)
- c.Assert(r.Remotes, HasLen, 1)
- c.Assert(r.Remotes[DefaultRemoteName], NotNil)
+
+ remotes, err := r.Remotes()
+ c.Assert(err, IsNil)
+ c.Assert(remotes, HasLen, 1)
head, err = r.Ref(core.HEAD, false)
c.Assert(err, IsNil)
@@ -150,8 +150,6 @@ func (s *RepositorySuite) TestCloneSingleBranch(c *C) {
r, err := NewMemoryRepository()
c.Assert(err, IsNil)
- c.Assert(r.Remotes, HasLen, 0)
-
head, err := r.Head()
c.Assert(err, Equals, core.ErrReferenceNotFound)
c.Assert(head, IsNil)
@@ -162,8 +160,10 @@ func (s *RepositorySuite) TestCloneSingleBranch(c *C) {
})
c.Assert(err, IsNil)
- c.Assert(r.Remotes, HasLen, 1)
- c.Assert(r.Remotes[DefaultRemoteName], NotNil)
+
+ remotes, err := r.Remotes()
+ c.Assert(err, IsNil)
+ c.Assert(remotes, HasLen, 1)
head, err = r.Ref(core.HEAD, false)
c.Assert(err, IsNil)
@@ -187,7 +187,6 @@ func (s *RepositorySuite) TestCloneDetachedHEAD(c *C) {
r, err := NewMemoryRepository()
c.Assert(err, IsNil)
- c.Assert(r.Remotes, HasLen, 0)
err = r.Clone(&RepositoryCloneOptions{
URL: RepositoryFixture,
ReferenceName: core.ReferenceName("refs/tags/v1.0.0"),