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

Function testParents

plumbing/object/commitgraph/commitnode_test.go:67–87  ·  view source on GitHub ↗
(c *C, nodeIndex CommitNodeIndex)

Source from the content-addressed store, hash-verified

65}
66
67func testParents(c *C, nodeIndex CommitNodeIndex) {
68 merge3, err := nodeIndex.Get(plumbing.NewHash("6f6c5d2be7852c782be1dd13e36496dd7ad39560"))
69 c.Assert(err, IsNil)
70
71 var parents []CommitNode
72 merge3.ParentNodes().ForEach(func(c CommitNode) error {
73 parents = append(parents, c)
74 return nil
75 })
76
77 c.Assert(parents, HasLen, 3)
78
79 expected := []string{
80 "ce275064ad67d51e99f026084e20827901a8361c",
81 "bb13916df33ed23004c3ce9ed3b8487528e655c1",
82 "a45273fe2d63300e1962a9e26a6b15c276cd7082",
83 }
84 for i, parent := range parents {
85 c.Assert(parent.ID().String(), Equals, expected[i])
86 }
87}
88
89func testCommitAndTree(c *C, nodeIndex CommitNodeIndex) {
90 merge3node, err := nodeIndex.Get(plumbing.NewHash("6f6c5d2be7852c782be1dd13e36496dd7ad39560"))

Callers 3

TestObjectGraphMethod · 0.85
TestCommitGraphMethod · 0.85
TestMixedGraphMethod · 0.85

Calls 6

NewHashFunction · 0.92
GetMethod · 0.65
ForEachMethod · 0.65
ParentNodesMethod · 0.65
StringMethod · 0.65
IDMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…