Submodule: use the Repository constructor
This commit is contained in:
parent
b6811196e4
commit
47191d1274
|
@ -298,16 +298,15 @@ func (sub *Submodule) Sync() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sub *Submodule) Open() (*Repository, error) {
|
func (sub *Submodule) Open() (*Repository, error) {
|
||||||
repo := new(Repository)
|
|
||||||
|
|
||||||
runtime.LockOSThread()
|
runtime.LockOSThread()
|
||||||
defer runtime.UnlockOSThread()
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
ret := C.git_submodule_open(&repo.ptr, sub.ptr)
|
var ptr *C.git_repository
|
||||||
|
ret := C.git_submodule_open(&ptr, sub.ptr)
|
||||||
if ret < 0 {
|
if ret < 0 {
|
||||||
return nil, MakeGitError(ret)
|
return nil, MakeGitError(ret)
|
||||||
}
|
}
|
||||||
return repo, nil
|
return newRepositoryFromC(ptr), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sub *Submodule) Update(init bool, opts *SubmoduleUpdateOptions) error {
|
func (sub *Submodule) Update(init bool, opts *SubmoduleUpdateOptions) error {
|
||||||
|
|
Loading…
Reference in New Issue