MCPcopy Index your code
hub / github.com/go-git/go-git / File

Method File

plumbing/object/commit.go:210–217  ·  view source on GitHub ↗

File returns the file with the specified "path" in the commit and a nil error if the file exists. If the file does not exist, it returns a nil file and the ErrFileNotFound error.

(path string)

Source from the content-addressed store, hash-verified

208// nil error if the file exists. If the file does not exist, it returns
209// a nil file and the ErrFileNotFound error.
210func (c *Commit) File(path string) (*File, error) {
211 tree, err := c.Tree()
212 if err != nil {
213 return nil, err
214 }
215
216 return tree.File(path)
217}
218
219// Files returns a FileIter allowing to iterate over the Tree
220func (c *Commit) Files() (*FileIter, error) {

Callers

nothing calls this directly

Calls 1

TreeMethod · 0.95

Tested by

no test coverage detected