diff options
Diffstat (limited to 'plumbing/object/treenoder.go')
-rw-r--r-- | plumbing/object/treenoder.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plumbing/object/treenoder.go b/plumbing/object/treenoder.go index 4da8298..8b56d1b 100644 --- a/plumbing/object/treenoder.go +++ b/plumbing/object/treenoder.go @@ -21,10 +21,11 @@ type treeNoder struct { name string // empty string for the root node mode filemode.FileMode hash plumbing.Hash - children []noder.Noder // memoized + children []noder.Noder // memorized } -func newTreeNoder(t *Tree) *treeNoder { +// NewTreeRootNode returns the root node of a Tree +func NewTreeRootNode(t *Tree) *treeNoder { if t == nil { return &treeNoder{} } @@ -74,7 +75,7 @@ func (t *treeNoder) Children() ([]noder.Noder, error) { return noder.NoChildren, nil } - // children are memoized for efficiency + // children are memorized for efficiency if t.children != nil { return t.children, nil } |