diff options
| author | Vicent Martà <[email protected]> | 2013-06-13 10:10:13 -0700 |
|---|---|---|
| committer | Vicent Martà <[email protected]> | 2013-06-13 10:10:13 -0700 |
| commit | 2c6cab80256ba4ecec61a8331a3364fb7c7fcad7 (patch) | |
| tree | 03ca732f4cb085894d7be0ed516fd2742a813884 /commit.go | |
| parent | 551e580a792a1b7f7e46e25d015ff4f835a6d4db (diff) | |
| parent | 543a6a87afc3ec68ba2a3af8d1046fd4dd4b6f58 (diff) | |
Merge pull request #29 from Merovius/parent
Implement Parent()-functions for Commits
Diffstat (limited to 'commit.go')
| -rw-r--r-- | commit.go | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 { |
