Example #1
0
func (sub *Submodule) Open() (*Repository, error) {
	repo := new(Repository)
	ret := C.git_submodule_open(&repo.ptr, sub.ptr)
	if ret < 0 {
		return nil, LastError()
	}
	return repo, nil
}
Example #2
0
func (sub *Submodule) Open() (*Repository, error) {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	var ptr *C.git_repository
	ret := C.git_submodule_open(&ptr, sub.ptr)
	if ret < 0 {
		return nil, MakeGitError(ret)
	}
	return newRepositoryFromC(ptr), nil
}
Example #3
0
func (sub *Submodule) Open() (*Repository, error) {
	repo := new(Repository)

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_submodule_open(&repo.ptr, sub.ptr)
	if ret < 0 {
		return nil, MakeGitError(ret)
	}
	return repo, nil
}