示例#1
0
func (repo *Repository) Detached() (bool, error) {
	detached := C.git_repository_head_detached(repo.git_repository)
	if detached == c_TRUE {
		return true, nil
	} else if detached == c_FALSE {
		return false, nil
	}
	return false, gitError()
}
示例#2
0
文件: repository.go 项目: wid/git2go
func (v *Repository) IsHeadDetached() (bool, error) {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_repository_head_detached(v.ptr)
	if ret < 0 {
		return false, MakeGitError(ret)
	}

	return ret != 0, nil
}