Merge commit 'refs/pull/198/head' of github.com:libgit2/git2go

This commit is contained in:
Carlos Martín Nieto 2015-07-01 15:58:21 +02:00
commit 84275e691f
1 changed files with 14 additions and 0 deletions

View File

@ -255,6 +255,20 @@ func (v *Repository) SetHeadDetached(id *Oid, sig *Signature, msg string) error
return nil
}
func (v *Repository) IsHeadDetached() (bool, error) {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
ret := C.git_repository_head_detached(v.ptr)
switch ret {
case 1:
return true, nil
case 0:
return false, nil
}
return false, MakeGitError(ret)
}
func (v *Repository) CreateReference(name string, id *Oid, force bool, sig *Signature, msg string) (*Reference, error) {
cname := C.CString(name)
defer C.free(unsafe.Pointer(cname))