aboutsummaryrefslogtreecommitdiffstats
path: root/commit.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-09-01 00:42:41 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-09-01 00:42:41 +0200
commit2ca4ab90ec5d4c430ac891a4edd5014d7043d539 (patch)
tree9741b5d6e28b79b0ec70160afdcf7babd58fe56b /commit.go
parent5bed3e8fab965738f3f55bb01d15cd4748c26066 (diff)
downloadgo-git-2ca4ab90ec5d4c430ac891a4edd5014d7043d539.tar.gz
examples: new clone example
Diffstat (limited to 'commit.go')
-rw-r--r--commit.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/commit.go b/commit.go
index 3e82a8a..8bb675a 100644
--- a/commit.go
+++ b/commit.go
@@ -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.
//