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

Method SetHeadDetached

repository.go:354–365  ·  view source on GitHub ↗
(id *Oid)

Source from the content-addressed store, hash-verified

352}
353
354func (v *Repository) SetHeadDetached(id *Oid) error {
355 runtime.LockOSThread()
356 defer runtime.UnlockOSThread()
357
358 ecode := C.git_repository_set_head_detached(v.ptr, id.toC())
359 runtime.KeepAlive(v)
360 runtime.KeepAlive(id)
361 if ecode != 0 {
362 return MakeGitError(ecode)
363 }
364 return nil
365}
366
367func (v *Repository) IsHeadDetached() (bool, error) {
368 runtime.LockOSThread()

Callers 1

checkoutFunction · 0.80

Calls 2

MakeGitErrorFunction · 0.85
toCMethod · 0.45

Tested by 1

checkoutFunction · 0.64