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

Function Repository_revparse_ext

src/repository.c:414–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412 "of the result tuple.");
413
414PyObject *
415Repository_revparse_ext(Repository *self, PyObject *py_spec)
416{
417 /* Get the C revision spec */
418 const char *c_spec = pgit_borrow(py_spec);
419 if (c_spec == NULL)
420 return NULL;
421
422 /* Lookup */
423 git_object *c_obj = NULL;
424 git_reference *c_ref = NULL;
425 int err = git_revparse_ext(&c_obj, &c_ref, self->repo, c_spec);
426 if (err)
427 return Error_set_str(err, c_spec);
428
429 PyObject *py_obj = wrap_object(c_obj, self, NULL);
430 PyObject *py_ref = NULL;
431 if (c_ref != NULL) {
432 py_ref = wrap_reference(c_ref, self);
433 } else {
434 py_ref = Py_None;
435 Py_INCREF(Py_None);
436 }
437 return Py_BuildValue("NN", py_obj, py_ref);
438}
439
440
441PyDoc_STRVAR(Repository_revparse__doc__,

Callers

nothing calls this directly

Calls 4

pgit_borrowFunction · 0.85
Error_set_strFunction · 0.85
wrap_objectFunction · 0.85
wrap_referenceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…