MCPcopy Create free account
hub / github.com/libgit2/git2go / TestTreeWalkSkip

Function TestTreeWalkSkip

tree_test.go:92–112  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

90}
91
92func TestTreeWalkSkip(t *testing.T) {
93 t.Parallel()
94 repo, err := OpenRepository("testdata/TestGitRepository.git")
95 checkFatal(t, err)
96 treeID, err := NewOid("6020a3b8d5d636e549ccbd0c53e2764684bb3125")
97 checkFatal(t, err)
98
99 tree, err := repo.LookupTree(treeID)
100 checkFatal(t, err)
101
102 var callCount int
103 err = tree.Walk(func(name string, entry *TreeEntry) error {
104 callCount++
105
106 return TreeWalkSkip
107 })
108 checkFatal(t, err)
109 if callCount != 4 {
110 t.Fatalf("got called %v times, want %v", callCount, 4)
111 }
112}
113
114func TestTreeWalkStop(t *testing.T) {
115 t.Parallel()

Callers

nothing calls this directly

Calls 5

OpenRepositoryFunction · 0.85
checkFatalFunction · 0.85
NewOidFunction · 0.85
LookupTreeMethod · 0.80
WalkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…