Get rid of Owner() on Remote and Submdoule
These are inherently unsafe. The underlying pointer might get released at any moment.
This commit is contained in:
parent
d400f1d5b2
commit
ba0a24087a
|
@ -421,10 +421,6 @@ func (repo *Repository) LookupRemote(name string) (*Remote, error) {
|
||||||
return remote, nil
|
return remote, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Remote) Owner() Repository {
|
|
||||||
return Repository{C.git_remote_owner(o.ptr)}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Remote) Name() string {
|
func (o *Remote) Name() string {
|
||||||
return C.GoString(C.git_remote_name(o.ptr))
|
return C.GoString(C.git_remote_name(o.ptr))
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,12 +158,6 @@ func (sub *Submodule) AddToIndex(write_index bool) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sub *Submodule) Owner() *Repository {
|
|
||||||
repo := C.git_submodule_owner(sub.ptr)
|
|
||||||
//FIXME: how to handle dangling references ?
|
|
||||||
return &Repository{repo}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sub *Submodule) Name() string {
|
func (sub *Submodule) Name() string {
|
||||||
n := C.git_submodule_name(sub.ptr)
|
n := C.git_submodule_name(sub.ptr)
|
||||||
return C.GoString(n)
|
return C.GoString(n)
|
||||||
|
|
Loading…
Reference in New Issue