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)
| 149 | // nil error if the file exists. If the file does not exist, it returns |
| 150 | // a nil file and the ErrFileNotFound error. |
| 151 | func (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 |
| 161 | func (c *Commit) Files() (*FileIter, error) { |