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

Function OdbBackendPack_init

src/odb_backend.c:594–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

592PyDoc_STRVAR(OdbBackendPack__doc__, "Object database backend for packfiles.");
593
594int
595OdbBackendPack_init(OdbBackendPack *self, PyObject *args, PyObject *kwds)
596{
597 if (kwds && PyDict_Size(kwds) > 0) {
598 PyErr_SetString(PyExc_TypeError, "OdbBackendPack takes no keyword arguments");
599 return -1;
600 }
601
602 PyObject *py_path;
603 if (!PyArg_ParseTuple(args, "O", &py_path))
604 return -1;
605
606 PyObject *tvalue;
607 char *path = pgit_borrow_fsdefault(py_path, &tvalue);
608 if (path == NULL)
609 return -1;
610
611 int err = git_odb_backend_pack(&self->super.odb_backend, path);
612 Py_DECREF(tvalue);
613 if (err) {
614 Error_set(err);
615 return -1;
616 }
617
618 return 0;
619}
620
621PyTypeObject OdbBackendPackType = {
622 PyVarObject_HEAD_INIT(NULL, 0)

Callers

nothing calls this directly

Calls 2

pgit_borrow_fsdefaultFunction · 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…