aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/tree.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-02-08 11:45:07 +0100
committerGitHub <noreply@github.com>2017-02-08 11:45:07 +0100
commitb65d94e70ea1d013f43234522fa092168e4f1041 (patch)
treeb36da73bd512d1b0ac52e4174ed8b7ed22c75b25 /plumbing/object/tree.go
parent431af32445562b389397f3ee7af90bf61455fff1 (diff)
parent84b6bd8c22c8683479881a67db03dfdeeeb299ce (diff)
downloadgo-git-b65d94e70ea1d013f43234522fa092168e4f1041.tar.gz
Merge pull request #259 from smola/docs
Improve documentation
Diffstat (limited to 'plumbing/object/tree.go')
-rw-r--r--plumbing/object/tree.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/plumbing/object/tree.go b/plumbing/object/tree.go
index 546dd74..3bcd80a 100644
--- a/plumbing/object/tree.go
+++ b/plumbing/object/tree.go
@@ -431,16 +431,17 @@ type TreeIter struct {
s storer.EncodedObjectStorer
}
-// NewTreeIter returns a TreeIter for the given repository and underlying
-// object iterator.
+// NewTreeIter takes a storer.EncodedObjectStorer and a
+// storer.EncodedObjectIter and returns a *TreeIter that iterates over all
+// tree contained in the storer.EncodedObjectIter.
//
-// The returned TreeIter will automatically skip over non-tree objects.
+// Any non-tree object returned by the storer.EncodedObjectIter is skipped.
func NewTreeIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *TreeIter {
return &TreeIter{iter, s}
}
-// Next moves the iterator to the next tree and returns a pointer to it. If it
-// has reached the end of the set it will return io.EOF.
+// Next moves the iterator to the next tree and returns a pointer to it. If
+// there are no more trees, it returns io.EOF.
func (iter *TreeIter) Next() (*Tree, error) {
for {
obj, err := iter.EncodedObjectIter.Next()