MCPcopy Create free account
hub / github.com/libgit2/pygit2 / Reference_peel

Function Reference_peel

src/reference.c:486–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484 "If no type is provided, the first non-tag object will be returned.");
485
486PyObject *
487Reference_peel(Reference *self, PyObject *args)
488{
489 int err;
490 git_otype otype;
491 git_object *obj;
492 PyObject *py_type = Py_None;
493
494 CHECK_REFERENCE(self);
495
496 if (!PyArg_ParseTuple(args, "|O", &py_type))
497 return NULL;
498
499 otype = py_object_to_otype(py_type);
500 if (otype == GIT_OBJECT_INVALID)
501 return NULL;
502
503 err = git_reference_peel(&obj, self->reference, otype);
504 if (err < 0)
505 return Error_set(err);
506
507 return wrap_object(obj, self->repo, NULL);
508}
509
510PyObject *
511Reference_richcompare(PyObject *o1, PyObject *o2, int op)

Callers

nothing calls this directly

Calls 3

py_object_to_otypeFunction · 0.85
Error_setFunction · 0.85
wrap_objectFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…