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

Function Odb_add_backend

src/odb.c:323–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321 "Adds an OdbBackend to the list of backends for this object database.\n");
322
323PyObject *
324Odb_add_backend(Odb *self, PyObject *args)
325{
326 int err, priority;
327 OdbBackend *backend;
328
329 if (!PyArg_ParseTuple(args, "OI", &backend, &priority))
330 return NULL;
331
332 if (!PyObject_IsInstance((PyObject *)backend, (PyObject *)&OdbBackendType)) {
333 PyErr_SetString(PyExc_TypeError, "add_backend expects an instance of pygit2.OdbBackend");
334 return NULL;
335 }
336
337 err = git_odb_add_backend(self->odb, backend->odb_backend, priority);
338 if (err != 0)
339 return Error_set(err);
340
341 Py_INCREF(backend);
342
343 Py_RETURN_NONE;
344}
345
346
347static PyMethodDef Odb_methods[] = {

Callers

nothing calls this directly

Calls 1

Error_setFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…