MCPcopy Create free account
hub / github.com/libgit2/git2go / Owner

Method Owner

object.go:84–89  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

82// This won't keep the underlying repository alive, but it should still be
83// Freed.
84func (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
91func dupObject(obj *Object, kind ObjectType) (*C.git_object, error) {
92 if obj.Type() != kind {

Callers 3

TestReferenceOwnerFunction · 0.45
WithSignatureMethod · 0.45
checkOwnerFunction · 0.45

Calls 1

newRepositoryFromCFunction · 0.85

Tested by 2

TestReferenceOwnerFunction · 0.36
checkOwnerFunction · 0.36