Add Repository.IsHeadUnborn

This commit is contained in:
Hans Rødtang 2016-03-29 20:42:19 +02:00
parent 094bb3767b
commit b99dbb1361
1 changed files with 11 additions and 0 deletions

View File

@ -268,6 +268,17 @@ func (v *Repository) IsHeadDetached() (bool, error) {
return ret != 0, nil
}
func (v *Repository) IsHeadUnborn() (bool, error) {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
ret := C.git_repository_head_unborn(v.ptr)
if ret < 0 {
return false, MakeGitError(ret)
}
return ret != 0, nil
}
func (v *Repository) Walk() (*RevWalk, error) {
var walkPtr *C.git_revwalk