MCPcopy Create free account
hub / github.com/libgit2/git2go / Parent

Method Parent

commit.go:167–177  ·  view source on GitHub ↗
(n uint)

Source from the content-addressed store, hash-verified

165}
166
167func (c *Commit) Parent(n uint) *Commit {
168 var cobj *C.git_commit
169 ret := C.git_commit_parent(&cobj, c.cast_ptr, C.uint(n))
170 if ret != 0 {
171 return nil
172 }
173
174 parent := allocCommit(cobj, c.repo)
175 runtime.KeepAlive(c)
176 return parent
177}
178
179func (c *Commit) ParentId(n uint) *Oid {
180 ret := newOidFromC(C.git_commit_parent_id(c.cast_ptr, C.uint(n)))

Callers 2

checkAllCommitsSignedFunction · 0.80
commitMsgsListFunction · 0.80

Calls 1

allocCommitFunction · 0.85

Tested by 2

checkAllCommitsSignedFunction · 0.64
commitMsgsListFunction · 0.64