diff options
author | Joshua Sjoding <joshs@scjalliance.com> | 2016-01-23 00:50:29 -0800 |
---|---|---|
committer | Joshua Sjoding <joshs@scjalliance.com> | 2016-01-23 00:50:29 -0800 |
commit | 7ba1014b73e4d466320a29f7e3f47fcefe58695d (patch) | |
tree | be9ff334eaae5547651d2084021fcfd4b70a9db9 /tree.go | |
parent | 050fb78d77b30014acd0b6eefc88ec8a49c20371 (diff) | |
download | go-git-7ba1014b73e4d466320a29f7e3f47fcefe58695d.tar.gz |
Repository now works against the generic ObjectStore interface
Diffstat (limited to 'tree.go')
-rw-r--r-- | tree.go | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -187,19 +187,20 @@ func (t *Tree) Decode(o core.Object) error { } type TreeIter struct { - iter + core.ObjectIter + r *Repository } -func NewTreeIter(r *Repository) *TreeIter { - return &TreeIter{newIter(r)} +func NewTreeIter(r *Repository, iter core.ObjectIter) *TreeIter { + return &TreeIter{iter, r} } -func (i *TreeIter) Next() (*Tree, error) { - obj := <-i.ch - if obj == nil { - return nil, io.EOF +func (iter *TreeIter) Next() (*Tree, error) { + obj, err := iter.ObjectIter.Next() + if err != nil { + return nil, err } - tree := &Tree{r: i.r} + tree := &Tree{r: iter.r} return tree, tree.Decode(obj) } |