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

Function pygit2_enum

src/utils.c:227–236  ·  view source on GitHub ↗

* Convert an integer to a reference to an IntEnum or IntFlag in pygit2.enums. */

Source from the content-addressed store, hash-verified

225 * Convert an integer to a reference to an IntEnum or IntFlag in pygit2.enums.
226 */
227PyObject *
228pygit2_enum(PyObject *enum_type, int value)
229{
230 if (!enum_type) {
231 PyErr_SetString(PyExc_TypeError, "an enum has not been cached in _pygit2.cache_enums()");
232 return NULL;
233 }
234 PyObject *enum_instance = PyObject_CallFunction(enum_type, "(i)", value);
235 return enum_instance;
236}

Callers 11

Reference_type__get__Function · 0.85
Object_filemode__get__Function · 0.85
Repository_statusFunction · 0.85
Repository_status_fileFunction · 0.85
DiffFile_flags__get__Function · 0.85
DiffFile_mode__get__Function · 0.85
DiffDelta_status__get__Function · 0.85
DiffDelta_flags__get__Function · 0.85
Odb_readFunction · 0.85
Odb_read_headerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…