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

Function testWalker

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

Source from the content-addressed store, hash-verified

31}
32
33func testWalker(c *C, nodeIndex CommitNodeIndex) {
34 head, err := nodeIndex.Get(plumbing.NewHash("b9d69064b190e7aedccf84731ca1d917871f8a1c"))
35 c.Assert(err, IsNil)
36
37 iter := NewCommitNodeIterCTime(
38 head,
39 nil,
40 nil,
41 )
42
43 var commits []CommitNode
44 iter.ForEach(func(c CommitNode) error {
45 commits = append(commits, c)
46 return nil
47 })
48
49 c.Assert(commits, HasLen, 9)
50
51 expected := []string{
52 "b9d69064b190e7aedccf84731ca1d917871f8a1c",
53 "6f6c5d2be7852c782be1dd13e36496dd7ad39560",
54 "a45273fe2d63300e1962a9e26a6b15c276cd7082",
55 "c0edf780dd0da6a65a7a49a86032fcf8a0c2d467",
56 "bb13916df33ed23004c3ce9ed3b8487528e655c1",
57 "03d2c021ff68954cf3ef0a36825e194a4b98f981",
58 "ce275064ad67d51e99f026084e20827901a8361c",
59 "e713b52d7e13807e87a002e812041f248db3f643",
60 "347c91919944a68e9413581a1bc15519550a3afe",
61 }
62 for i, commit := range commits {
63 c.Assert(commit.ID().String(), Equals, expected[i])
64 }
65}
66
67func testParents(c *C, nodeIndex CommitNodeIndex) {
68 merge3, err := nodeIndex.Get(plumbing.NewHash("6f6c5d2be7852c782be1dd13e36496dd7ad39560"))

Callers 3

TestObjectGraphMethod · 0.85
TestCommitGraphMethod · 0.85
TestMixedGraphMethod · 0.85

Calls 6

NewHashFunction · 0.92
NewCommitNodeIterCTimeFunction · 0.85
GetMethod · 0.65
ForEachMethod · 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…