aboutsummaryrefslogtreecommitdiffstats
path: root/commit.go
diff options
context:
space:
mode:
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.
//