summaryrefslogtreecommitdiff
path: root/commit.go
diff options
context:
space:
mode:
authorAxel Wagner <[email protected]>2013-05-21 23:18:02 +0200
committerAxel Wagner <[email protected]>2013-05-21 23:18:02 +0200
commit543a6a87afc3ec68ba2a3af8d1046fd4dd4b6f58 (patch)
tree7e9d540cce09d4e9265b341f27463da077efa506 /commit.go
parent4e0a28b064047513194a842e9c16d9beab545f41 (diff)
Implement Parent()-functions for Commits
Diffstat (limited to 'commit.go')
-rw-r--r--commit.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/commit.go b/commit.go
index d31f684..06d1a22 100644
--- a/commit.go
+++ b/commit.go
@@ -53,6 +53,23 @@ func (c *Commit) Committer() *Signature {
return newSignatureFromC(ptr)
}
+func (c *Commit) Parent(n uint) *Commit {
+ par := &Commit{}
+ ret := C.git_commit_parent(&par.ptr, c.ptr, C.uint(n))
+ if ret != 0 {
+ return nil
+ }
+ return par
+}
+
+func (c *Commit) ParentId(n uint) *Oid {
+ return newOidFromC(C.git_commit_parent_id(c.ptr, C.uint(n)))
+}
+
+func (c *Commit) ParentCount() uint {
+ return uint(C.git_commit_parentcount(c.ptr))
+}
+
// Signature
type Signature struct {