(i int)
| 92 | } |
| 93 | |
| 94 | func (c *graphCommitNode) ParentNode(i int) (CommitNode, error) { |
| 95 | if i < 0 || i >= len(c.commitData.ParentIndexes) { |
| 96 | return nil, object.ErrParentNotFound |
| 97 | } |
| 98 | |
| 99 | parent, err := c.gci.commitGraph.GetCommitDataByIndex(c.commitData.ParentIndexes[i]) |
| 100 | if err != nil { |
| 101 | return nil, err |
| 102 | } |
| 103 | |
| 104 | return &graphCommitNode{ |
| 105 | hash: c.commitData.ParentHashes[i], |
| 106 | index: c.commitData.ParentIndexes[i], |
| 107 | commitData: parent, |
| 108 | gci: c.gci, |
| 109 | }, nil |
| 110 | } |
| 111 | |
| 112 | func (c *graphCommitNode) ParentHashes() []plumbing.Hash { |
| 113 | return c.commitData.ParentHashes |
nothing calls this directly
no test coverage detected