diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-01 00:42:41 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-01 00:42:41 +0200 |
commit | 2ca4ab90ec5d4c430ac891a4edd5014d7043d539 (patch) | |
tree | 9741b5d6e28b79b0ec70160afdcf7babd58fe56b /commit.go | |
parent | 5bed3e8fab965738f3f55bb01d15cd4748c26066 (diff) | |
download | go-git-2ca4ab90ec5d4c430ac891a4edd5014d7043d539.tar.gz |
examples: new clone example
Diffstat (limited to 'commit.go')
-rw-r--r-- | commit.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -60,6 +60,16 @@ func (c *Commit) File(path string) (*File, error) { return tree.File(path) } +// Files returns a FileIter allowing to iterate over the Tree +func (c *Commit) Files() (*FileIter, error) { + tree, err := c.Tree() + if err != nil { + return nil, err + } + + return tree.Files(), nil +} + // ID returns the object ID of the commit. The returned value will always match // the current value of Commit.Hash. // |