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

Function allocCommit

object.go:132–143  ·  view source on GitHub ↗
(ptr *C.git_commit, repo *Repository)

Source from the content-addressed store, hash-verified

130}
131
132func allocCommit(ptr *C.git_commit, repo *Repository) *Commit {
133 commit := &Commit{
134 Object: Object{
135 ptr: (*C.git_object)(ptr),
136 repo: repo,
137 },
138 cast_ptr: ptr,
139 }
140 runtime.SetFinalizer(commit, (*Commit).Free)
141
142 return commit
143}
144
145func (o *Object) AsCommit() (*Commit, error) {
146 cobj, err := dupObject(o, ObjectCommit)

Callers 2

AsCommitMethod · 0.85
ParentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…