Owner returns a weak reference to the repository which owns this object. This won't keep the underlying repository alive, but it should still be Freed.
()
| 82 | // This won't keep the underlying repository alive, but it should still be |
| 83 | // Freed. |
| 84 | func (o *Object) Owner() *Repository { |
| 85 | repo := newRepositoryFromC(C.git_object_owner(o.ptr)) |
| 86 | runtime.KeepAlive(o) |
| 87 | repo.weak = true |
| 88 | return repo |
| 89 | } |
| 90 | |
| 91 | func dupObject(obj *Object, kind ObjectType) (*C.git_object, error) { |
| 92 | if obj.Type() != kind { |