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

Method Next

branch.go:44–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42}
43
44func (i *BranchIterator) Next() (*Branch, BranchType, error) {
45
46 runtime.LockOSThread()
47 defer runtime.UnlockOSThread()
48
49 var refPtr *C.git_reference
50 var refType C.git_branch_t
51
52 ecode := C.git_branch_next(&refPtr, &refType, i.ptr)
53
54 if ecode < 0 {
55 return nil, BranchLocal, MakeGitError(ecode)
56 }
57
58 branch := newReferenceFromC(refPtr, i.repo).Branch()
59
60 return branch, BranchType(refType), nil
61}
62
63func (i *BranchIterator) Free() {
64 runtime.SetFinalizer(i, nil)

Callers 2

ForEachMethod · 0.95
TestBranchIteratorFunction · 0.95

Calls 4

MakeGitErrorFunction · 0.85
newReferenceFromCFunction · 0.85
BranchTypeTypeAlias · 0.85
BranchMethod · 0.80

Tested by 1

TestBranchIteratorFunction · 0.76