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

Method LookupCommit

repository.go:262–270  ·  view source on GitHub ↗
(id *Oid)

Source from the content-addressed store, hash-verified

260}
261
262func (v *Repository) LookupCommit(id *Oid) (*Commit, error) {
263 obj, err := v.lookupType(id, ObjectCommit)
264 if err != nil {
265 return nil, err
266 }
267 defer obj.Free()
268
269 return obj.AsCommit()
270}
271
272// LookupPrefixCommit looks up a commit by its OID given a prefix of its identifier.
273func (v *Repository) LookupPrefixCommit(id *Oid, prefix uint) (*Commit, error) {

Callers 15

TestRevertFunction · 0.80
TestRevertCommitFunction · 0.80
TestCreateNoteFunction · 0.80
TestNoteIteratorFunction · 0.80
TestRemoveNoteFunction · 0.80
TestRemotePruneFunction · 0.80
TestCherrypickFunction · 0.80
TestCherrypickCommitFunction · 0.80
performRebaseOntoFunction · 0.80
headCommitFunction · 0.80
commitSomethingFunction · 0.80

Calls 3

lookupTypeMethod · 0.95
AsCommitMethod · 0.80
FreeMethod · 0.65

Tested by 15

TestRevertFunction · 0.64
TestRevertCommitFunction · 0.64
TestCreateNoteFunction · 0.64
TestNoteIteratorFunction · 0.64
TestRemoveNoteFunction · 0.64
TestRemotePruneFunction · 0.64
TestCherrypickFunction · 0.64
TestCherrypickCommitFunction · 0.64
performRebaseOntoFunction · 0.64
headCommitFunction · 0.64
commitSomethingFunction · 0.64