diff --git a/modules/git/tree_entry.go b/modules/git/tree_entry.go index c4085c0278f33..95131214872e6 100644 --- a/modules/git/tree_entry.go +++ b/modules/git/tree_entry.go @@ -101,12 +101,13 @@ func (te *TreeEntry) FollowLinks() (*TreeEntry, error) { return entry, nil } -// returns the subtree, or nil if this is not a tree +// returns the Tree pointed to by this TreeEntry, or nil if this is not a tree func (te *TreeEntry) Tree() *Tree { t, err := te.ptree.repo.getTree(te.ID) if err != nil { return nil } + t.ptree = te.ptree return t }