TreeEntryFile returns the *File for a given *TreeEntry.
(e *TreeEntry)
| 118 | |
| 119 | // TreeEntryFile returns the *File for a given *TreeEntry. |
| 120 | func (t *Tree) TreeEntryFile(e *TreeEntry) (*File, error) { |
| 121 | blob, err := GetBlob(t.s, e.Hash) |
| 122 | if err != nil { |
| 123 | return nil, err |
| 124 | } |
| 125 | |
| 126 | return NewFile(e.Name, e.Mode, blob), nil |
| 127 | } |
| 128 | |
| 129 | // FindEntry search a TreeEntry in this tree or any subtree. |
| 130 | func (t *Tree) FindEntry(path string) (*TreeEntry, error) { |