| 83 | } |
| 84 | |
| 85 | func (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 | |
| 101 | func (repo *Repository) CreateBranch(branchName string, target *Commit, force bool) (*Branch, error) { |
| 102 | |