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

Method Iterate

walk.go:182–205  ·  view source on GitHub ↗
(fun RevWalkIterator)

Source from the content-addressed store, hash-verified

180type RevWalkIterator func(commit *Commit) bool
181
182func (v *RevWalk) Iterate(fun RevWalkIterator) (err error) {
183 oid := new(Oid)
184 for {
185 err = v.Next(oid)
186 if IsErrorCode(err, ErrorCodeIterOver) {
187 return nil
188 }
189 if err != nil {
190 return err
191 }
192
193 commit, err := v.repo.LookupCommit(oid)
194 if err != nil {
195 return err
196 }
197
198 cont := fun(commit)
199 if !cont {
200 break
201 }
202 }
203
204 return nil
205}
206
207func (v *RevWalk) SimplifyFirstParent() {
208 C.git_revwalk_simplify_first_parent(v.ptr)

Callers

nothing calls this directly

Calls 3

NextMethod · 0.95
IsErrorCodeFunction · 0.85
LookupCommitMethod · 0.80

Tested by

no test coverage detected