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

Method Peel

reference.go:283–296  ·  view source on GitHub ↗
(t ObjectType)

Source from the content-addressed store, hash-verified

281}
282
283func (v *Reference) Peel(t ObjectType) (*Object, error) {
284 var cobj *C.git_object
285
286 runtime.LockOSThread()
287 defer runtime.UnlockOSThread()
288
289 err := C.git_reference_peel(&cobj, v.ptr, C.git_object_t(t))
290 runtime.KeepAlive(v)
291 if err < 0 {
292 return nil, MakeGitError(err)
293 }
294
295 return allocObject(cobj, v.repo), nil
296}
297
298// Owner returns a weak reference to the repository which owns this reference.
299// This won't keep the underlying repository alive, but it should still be

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
allocObjectFunction · 0.85

Tested by

no test coverage detected