Пример #1
0
func (repo *Repository) SetWorkdir(workdir string, updateGitlink bool) error {
	cstr := C.CString(workdir)
	defer C.free(unsafe.Pointer(cstr))

	if C.git_repository_set_workdir(repo.ptr, cstr, cbool(updateGitlink)) < 0 {
		return LastError()
	}
	return nil
}
Пример #2
0
func (repo *Repository) SetWorkdir(path string) error {
	cpath := C.CString(path)
	defer C.free(unsafe.Pointer(cpath))
	ecode := C.git_repository_set_workdir(repo.git_repository, cpath)
	if ecode != git_SUCCESS {
		return gitError()
	}
	return nil
}
Пример #3
0
func (repo *Repository) SetWorkdir(workdir string, updateGitlink bool) error {
	cstr := C.CString(workdir)
	defer C.free(unsafe.Pointer(cstr))

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	if ret := C.git_repository_set_workdir(repo.ptr, cstr, cbool(updateGitlink)); ret < 0 {
		return MakeGitError(ret)
	}

	return nil
}