aboutsummaryrefslogtreecommitdiffstats
path: root/commit.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-05-19 16:44:59 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-05-19 16:44:59 +0200
commit25077df01588b54ec097ce3f99db6672c5a59463 (patch)
tree49f7b64f4164d19260ba848c5faca366b75438d1 /commit.go
parent08f9e7015aad2ca768638b446fb8632f11601899 (diff)
downloadgo-git-25077df01588b54ec097ce3f99db6672c5a59463.tar.gz
documentation
Diffstat (limited to 'commit.go')
-rw-r--r--commit.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/commit.go b/commit.go
index d9f8304..94b9500 100644
--- a/commit.go
+++ b/commit.go
@@ -10,6 +10,7 @@ import (
"gopkg.in/src-d/go-git.v3/core"
)
+// Hash hash of an object
type Hash core.Hash
// Commit points to a single tree, marking it as what the project looked like
@@ -28,11 +29,13 @@ type Commit struct {
r *Repository
}
+// Tree returns the Tree from the commit
func (c *Commit) Tree() *Tree {
tree, _ := c.r.Tree(c.tree) // FIXME: Return error as well?
return tree
}
+// Parents return a CommitIter to the parent Commits
func (c *Commit) Parents() *CommitIter {
return NewCommitIter(c.r, core.NewObjectLookupIter(c.r.Storage, c.parents))
}