diff options
Diffstat (limited to 'tree_walker.go')
-rw-r--r-- | tree_walker.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/tree_walker.go b/tree_walker.go index 1692c2f..5568e1b 100644 --- a/tree_walker.go +++ b/tree_walker.go @@ -3,8 +3,6 @@ package git import ( "io" "path" - - "gopkg.in/src-d/go-git.v4/core" ) const ( @@ -93,27 +91,6 @@ func (w *TreeWalker) Next() (name string, entry TreeEntry, obj Object, err error return } -func (w *TreeWalker) ForEach(cb func(fullpath string, e TreeEntry) error) error { - for { - path, e, _, err := w.Next() - if err != nil { - if err == io.EOF { - return nil - } - - return err - } - - if err := cb(path, e); err != nil { - if err == core.ErrStop { - return nil - } - - return err - } - } -} - // Tree returns the tree that the tree walker most recently operated on. func (w *TreeWalker) Tree() *Tree { current := len(w.stack) - 1 |