MCPcopy Create free account
hub / github.com/go-git/go-git / TreeEntryFile

Method TreeEntryFile

plumbing/object/tree.go:120–127  ·  view source on GitHub ↗

TreeEntryFile returns the *File for a given *TreeEntry.

(e *TreeEntry)

Source from the content-addressed store, hash-verified

118
119// TreeEntryFile returns the *File for a given *TreeEntry.
120func (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.
130func (t *Tree) FindEntry(path string) (*TreeEntry, error) {

Callers 1

FilesMethod · 0.80

Calls 2

GetBlobFunction · 0.85
NewFileFunction · 0.85

Tested by

no test coverage detected