| 64 | } |
| 65 | |
| 66 | func (c *objectCommitNode) ParentNode(i int) (CommitNode, error) { |
| 67 | if i < 0 || i >= len(c.commit.ParentHashes) { |
| 68 | return nil, object.ErrParentNotFound |
| 69 | } |
| 70 | |
| 71 | // Note: It's necessary to go through CommitNodeIndex here to ensure |
| 72 | // that if the commit-graph file covers only part of the history we |
| 73 | // start using it when that part is reached. |
| 74 | return c.nodeIndex.Get(c.commit.ParentHashes[i]) |
| 75 | } |
| 76 | |
| 77 | func (c *objectCommitNode) ParentHashes() []plumbing.Hash { |
| 78 | return c.commit.ParentHashes |