Add some constants and repository methods. #301

Merged
hansrodtang merged 5 commits from next into next 2016-03-31 06:44:23 -05:00
1 changed files with 11 additions and 0 deletions
Showing only changes of commit b99dbb1361 - Show all commits

View File

@ -268,6 +268,17 @@ func (v *Repository) IsHeadDetached() (bool, error) {
return ret != 0, nil 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) { func (v *Repository) Walk() (*RevWalk, error) {
var walkPtr *C.git_revwalk var walkPtr *C.git_revwalk