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

Function DecodeCommit

plumbing/object/commit.go:81–88  ·  view source on GitHub ↗

DecodeCommit decodes an encoded object into a *Commit and associates it to the given object storer.

(s storer.EncodedObjectStorer, o plumbing.EncodedObject)

Source from the content-addressed store, hash-verified

79// DecodeCommit decodes an encoded object into a *Commit and associates it to
80// the given object storer.
81func DecodeCommit(s storer.EncodedObjectStorer, o plumbing.EncodedObject) (*Commit, error) {
82 c := &Commit{s: s}
83 if err := c.Decode(o); err != nil {
84 return nil, err
85 }
86
87 return c, nil
88}
89
90// Tree returns the Tree from the commit.
91func (c *Commit) Tree() (*Tree, error) {

Callers 6

TestStringMultiLineMethod · 0.85
DecodeObjectFunction · 0.85
CommitMethod · 0.85
GetCommitFunction · 0.85
NextMethod · 0.85
ForEachMethod · 0.85

Calls 1

DecodeMethod · 0.95

Tested by 1

TestStringMultiLineMethod · 0.68