Tree returns the tree identified by the `path` argument. The path is interpreted as relative to the tree receiver.
(path string)
| 105 | // Tree returns the tree identified by the `path` argument. |
| 106 | // The path is interpreted as relative to the tree receiver. |
| 107 | func (t *Tree) Tree(path string) (*Tree, error) { |
| 108 | e, err := t.FindEntry(path) |
| 109 | if err != nil { |
| 110 | return nil, ErrDirectoryNotFound |
| 111 | } |
| 112 | |
| 113 | tree, err := GetTree(t.s, e.Hash) |
| 114 | if err == plumbing.ErrObjectNotFound { |
| 115 | return nil, ErrDirectoryNotFound |
| 116 | } |
| 117 | |
| 118 | return tree, err |
| 119 | } |
| 120 | |
| 121 | // TreeEntryFile returns the *File for a given *TreeEntry. |
| 122 | // |