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

Method File

plumbing/object/commit.go:151–158  ·  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

149// nil error if the file exists. If the file does not exist, it returns
150// a nil file and the ErrFileNotFound error.
151func (c *Commit) File(path string) (*File, error) {
152 tree, err := c.Tree()
153 if err != nil {
154 return nil, err
155 }
156
157 return tree.File(path)
158}
159
160// Files returns a FileIter allowing to iterate over the Tree
161func (c *Commit) Files() (*FileIter, error) {

Callers

nothing calls this directly

Calls 1

TreeMethod · 0.95

Tested by

no test coverage detected