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

Method IsHead

branch.go:149–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147}
148
149func (b *Branch) IsHead() (bool, error) {
150
151 runtime.LockOSThread()
152 defer runtime.UnlockOSThread()
153
154 ret := C.git_branch_is_head(b.Reference.ptr)
155 runtime.KeepAlive(b.Reference)
156 switch ret {
157 case 1:
158 return true, nil
159 case 0:
160 return false, nil
161 }
162 return false, MakeGitError(ret)
163
164}
165
166func (repo *Repository) LookupBranch(branchName string, bt BranchType) (*Branch, error) {
167 var ptr *C.git_reference

Callers

nothing calls this directly

Calls 1

MakeGitErrorFunction · 0.85

Tested by

no test coverage detected