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 (commit *Commit) Parent(n uint) (*Commit, error) { parent := new(Commit) ecode := C.git_commit_parent(&parent.git_commit, commit.git_commit, C.uint(n)) if ecode != git_SUCCESS { return nil, gitError() } return parent, nil }
func (c *Commit) Parent(n uint) *Commit { var cobj *C.git_commit ret := C.git_commit_parent(&cobj, c.cast_ptr, C.uint(n)) if ret != 0 { return nil } return allocObject((*C.git_object)(cobj), c.repo).(*Commit) }
func (c *Commit) Parent(n uint) *Commit { var cobj *C.git_commit ret := C.git_commit_parent(&cobj, c.cast_ptr, C.uint(n)) if ret != 0 { return nil } return allocCommit(cobj, c.repo) }