MCPcopy
hub / github.com/go-git/go-git / GetCommit

Function GetCommit

plumbing/object/commit.go:124–131  ·  view source on GitHub ↗

GetCommit gets a commit from an object storer and decodes it.

(s storer.EncodedObjectStorer, h plumbing.Hash)

Source from the content-addressed store, hash-verified

122
123// GetCommit gets a commit from an object storer and decodes it.
124func GetCommit(s storer.EncodedObjectStorer, h plumbing.Hash) (*Commit, error) {
125 o, err := s.EncodedObject(plumbing.CommitObject, h)
126 if err != nil {
127 return nil, err
128 }
129
130 return DecodeCommit(s, o)
131}
132
133// DecodeCommit decodes an encoded object into a *Commit and associates it to
134// the given object storer.

Callers 15

CommitObjectMethod · 0.92
addReachableTagsMethod · 0.92
addOrUpdateReferencesMethod · 0.92
getHavesFromRefFunction · 0.92
isFastForwardFunction · 0.92
GetMethod · 0.92
CommitMethod · 0.92
GetMethod · 0.92
TestDecodeMultiChainMethod · 0.92
TestIterMethod · 0.85
TestContentsMethod · 0.85

Calls 2

DecodeCommitFunction · 0.85
EncodedObjectMethod · 0.65

Tested by 15

TestDecodeMultiChainMethod · 0.74
TestIterMethod · 0.68
TestContentsMethod · 0.68
TestLinesMethod · 0.68
TestFileIterMethod · 0.68
TestFileIterSubmoduleMethod · 0.68
commitFromStorerMethod · 0.68
TestTreeDiffMethod · 0.68
TestTreeWalkerNextMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…