MCPcopy Create free account
hub / github.com/go-git/go-git / GetCommit

Function GetCommit

plumbing/object/commit.go:70–77  ·  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

68
69// GetCommit gets a commit from an object storer and decodes it.
70func GetCommit(s storer.EncodedObjectStorer, h plumbing.Hash) (*Commit, error) {
71 o, err := s.EncodedObject(plumbing.CommitObject, h)
72 if err != nil {
73 return nil, err
74 }
75
76 return DecodeCommit(s, o)
77}
78
79// DecodeCommit decodes an encoded object into a *Commit and associates it to
80// 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