diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-05-19 16:44:59 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-05-19 16:44:59 +0200 |
commit | 25077df01588b54ec097ce3f99db6672c5a59463 (patch) | |
tree | 49f7b64f4164d19260ba848c5faca366b75438d1 /tree_walker.go | |
parent | 08f9e7015aad2ca768638b446fb8632f11601899 (diff) | |
download | go-git-25077df01588b54ec097ce3f99db6672c5a59463.tar.gz |
documentation
Diffstat (limited to 'tree_walker.go')
-rw-r--r-- | tree_walker.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tree_walker.go b/tree_walker.go index ff44e67..9bc1421 100644 --- a/tree_walker.go +++ b/tree_walker.go @@ -11,7 +11,7 @@ const ( // TreeWalker provides a means of walking through all of the entries in a Tree. type TreeWalker struct { - stack []TreeEntryIter + stack []treeEntryIter base string r *Repository @@ -23,11 +23,11 @@ type TreeWalker struct { // tree walker. func NewTreeWalker(r *Repository, t *Tree) *TreeWalker { w := TreeWalker{ - stack: make([]TreeEntryIter, 0, startingStackSize), + stack: make([]treeEntryIter, 0, startingStackSize), base: "", r: r, } - w.stack = append(w.stack, *NewTreeEntryIter(t)) + w.stack = append(w.stack, treeEntryIter{t, 0}) return &w } @@ -65,7 +65,7 @@ func (w *TreeWalker) Next() (name string, entry TreeEntry, obj Object, err error } obj, err = w.r.Object(entry.Hash) - if err == ObjectNotFoundErr { + if err == ErrObjectNotFound { // FIXME: Avoid doing this here in case the caller actually cares about // missing objects. err = nil @@ -81,8 +81,8 @@ func (w *TreeWalker) Next() (name string, entry TreeEntry, obj Object, err error break } - if tree, ok := obj.(*Tree); ok { - w.stack = append(w.stack, *NewTreeEntryIter(tree)) + if t, ok := obj.(*Tree); ok { + w.stack = append(w.stack, treeEntryIter{t, 0}) w.base = path.Join(w.base, entry.Name) } |