GetCommit gets a commit from an object storer and decodes it.
(s storer.EncodedObjectStorer, h plumbing.Hash)
| 68 | |
| 69 | // GetCommit gets a commit from an object storer and decodes it. |
| 70 | func 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. |