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