MCPcopy
hub / github.com/go-git/go-git / Tree

Method Tree

plumbing/object/tree.go:107–119  ·  view source on GitHub ↗

Tree returns the tree identified by the `path` argument. The path is interpreted as relative to the tree receiver.

(path string)

Source from the content-addressed store, hash-verified

105// Tree returns the tree identified by the `path` argument.
106// The path is interpreted as relative to the tree receiver.
107func (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//

Callers

nothing calls this directly

Calls 2

FindEntryMethod · 0.95
GetTreeFunction · 0.85

Tested by

no test coverage detected