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

Function Commit_parent_ids__get__

src/commit.c:278–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276PyDoc_STRVAR(Commit_parent_ids__doc__, "The list of parent commits' ids.");
277
278PyObject *
279Commit_parent_ids__get__(Commit *self)
280{
281 unsigned int i, parent_count;
282 const git_oid *id;
283 PyObject *list;
284
285 if (Object__load((Object*)self) == NULL) { return NULL; } // Lazy load
286
287 parent_count = git_commit_parentcount(self->commit);
288 list = PyList_New(parent_count);
289 if (!list)
290 return NULL;
291
292 for (i=0; i < parent_count; i++) {
293 id = git_commit_parent_id(self->commit, i);
294 PyList_SET_ITEM(list, i, git_oid_to_python(id));
295 }
296
297 return list;
298}
299
300PyGetSetDef Commit_getseters[] = {
301 GETTER(Commit, message_encoding),

Callers

nothing calls this directly

Calls 2

Object__loadFunction · 0.85
git_oid_to_pythonFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…