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

Function Repository_descendant_of

src/repository.c:522–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520 "Note that a commit is not considered a descendant of itself.");
521
522PyObject *
523Repository_descendant_of(Repository *self, PyObject *args)
524{
525 PyObject *value1;
526 PyObject *value2;
527 git_oid oid1;
528 git_oid oid2;
529 int err;
530
531 if (!PyArg_ParseTuple(args, "OO", &value1, &value2))
532 return NULL;
533
534 err = py_oid_to_git_oid_expand(self->repo, value1, &oid1);
535 if (err < 0)
536 return NULL;
537
538 err = py_oid_to_git_oid_expand(self->repo, value2, &oid2);
539 if (err < 0)
540 return NULL;
541
542 // err < 0 => error, see source code of `git_graph_descendant_of`
543 err = git_graph_descendant_of(self->repo, &oid1, &oid2);
544 if (err < 0)
545 return Error_set(err);
546
547 return PyBool_FromLong(err);
548}
549
550PyDoc_STRVAR(Repository_merge_base__doc__,
551 "merge_base(oid1: Oid, oid2: Oid) -> Oid\n"

Callers

nothing calls this directly

Calls 2

py_oid_to_git_oid_expandFunction · 0.85
Error_setFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…