expose commit parent refs (#1963)

* expose commit parent refs

* no need for ctx

* adding commentt
This commit is contained in:
Brian Hendriks
2021-08-02 14:48:59 -07:00
committed by GitHub
parent c5efbd8d3e
commit 76212aae15

View File

@@ -131,6 +131,11 @@ func (c *Commit) GetCommitMeta() (*CommitMeta, error) {
return nil, errors.New(h.String() + " is a commit without the required metadata.")
}
// ParentRefs returns the noms types.Refs for the commits
func (c *Commit) ParentRefs() []types.Ref {
return c.parents
}
// ParentHashes returns the commit hashes for all parent commits.
func (c *Commit) ParentHashes(ctx context.Context) ([]hash.Hash, error) {
hashes := make([]hash.Hash, len(c.parents))