DecodeCommit decodes an encoded object into a *Commit and associates it to the given object storer.
(s storer.EncodedObjectStorer, o plumbing.EncodedObject)
| 79 | // DecodeCommit decodes an encoded object into a *Commit and associates it to |
| 80 | // the given object storer. |
| 81 | func 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. |
| 91 | func (c *Commit) Tree() (*Tree, error) { |