MCPcopy Index your code
hub / github.com/go-git/go-git / ParentNode

Method ParentNode

plumbing/object/commitgraph/commitnode_object.go:66–75  ·  view source on GitHub ↗
(i int)

Source from the content-addressed store, hash-verified

64}
65
66func (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
77func (c *objectCommitNode) ParentHashes() []plumbing.Hash {
78 return c.commit.ParentHashes

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected