Beispiel #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()
}
Beispiel #2
0
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
}