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

Method NewBranchIterator

branch.go:85–99  ·  view source on GitHub ↗
(flags BranchType)

Source from the content-addressed store, hash-verified

83}
84
85func (repo *Repository) NewBranchIterator(flags BranchType) (*BranchIterator, error) {
86 refType := C.git_branch_t(flags)
87 var ptr *C.git_branch_iterator
88
89 runtime.LockOSThread()
90 defer runtime.UnlockOSThread()
91
92 ecode := C.git_branch_iterator_new(&ptr, repo.ptr, refType)
93 runtime.KeepAlive(repo)
94 if ecode < 0 {
95 return nil, MakeGitError(ecode)
96 }
97
98 return newBranchIteratorFromC(repo, ptr), nil
99}
100
101func (repo *Repository) CreateBranch(branchName string, target *Commit, force bool) (*Branch, error) {
102

Callers 2

TestBranchIteratorFunction · 0.80
TestBranchIteratorEachFunction · 0.80

Calls 2

MakeGitErrorFunction · 0.85
newBranchIteratorFromCFunction · 0.85

Tested by 2

TestBranchIteratorFunction · 0.64
TestBranchIteratorEachFunction · 0.64