aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-10-27 02:42:36 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-10-27 02:42:36 +0200
commit0c6c4047155692caff733d0cd239b80508b7bd04 (patch)
tree522bc02e7c5e4f4f3968a7b38c74bc9773097d1f /repository_test.go
parent0c3bc0c8b3eabe16e927475f26044ca9aaa50351 (diff)
downloadgo-git-0c6c4047155692caff733d0cd239b80508b7bd04.tar.gz
remote, fix fetch tags
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/repository_test.go b/repository_test.go
index 07fa763..b67e31d 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -314,24 +314,27 @@ func (s *RepositorySuite) TestTag(c *C) {
func (s *RepositorySuite) TestTags(c *C) {
r := NewMemoryRepository()
- err := r.Clone(&CloneOptions{URL: "https://github.com/spinnaker/spinnaker.git"})
+ err := r.Clone(&CloneOptions{URL: "https://github.com/git-fixtures/tags.git"})
c.Assert(err, IsNil)
count := 0
tags, err := r.Tags()
c.Assert(err, IsNil)
- for {
- tag, err := tags.Next()
- if err != nil {
- break
- }
+ tags.ForEach(func(tag *Tag) error {
count++
c.Assert(tag.Hash.IsZero(), Equals, false)
c.Assert(tag.Type(), Equals, core.TagObject)
- }
- c.Assert(count, Equals, 11)
+ return nil
+ })
+
+ refs, _ := r.Refs()
+ refs.ForEach(func(ref *core.Reference) error {
+ return nil
+ })
+
+ c.Assert(count, Equals, 4)
}
func (s *RepositorySuite) TestCommitIterClosePanic(c *C) {