| 321 | "Adds an OdbBackend to the list of backends for this object database.\n"); |
| 322 | |
| 323 | PyObject * |
| 324 | Odb_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 | |
| 347 | static PyMethodDef Odb_methods[] = { |
nothing calls this directly
no test coverage detected
searching dependent graphs…