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

Function OdbBackendLoose_init

src/odb_backend.c:685–714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

683 " mode for new files, or 0 for default");
684
685int
686OdbBackendLoose_init(OdbBackendLoose *self, PyObject *args, PyObject *kwds)
687{
688 if (kwds && PyDict_Size(kwds) > 0) {
689 PyErr_SetString(PyExc_TypeError, "OdbBackendLoose takes no keyword arguments");
690 return -1;
691 }
692
693 PyObject *py_path;
694 int compression_level, do_fsync;
695 unsigned int dir_mode = 0, file_mode = 0;
696 if (!PyArg_ParseTuple(args, "Oip|II", &py_path, &compression_level,
697 &do_fsync, &dir_mode, &file_mode))
698 return -1;
699
700 PyObject *tvalue;
701 char *path = pgit_borrow_fsdefault(py_path, &tvalue);
702 if (path == NULL)
703 return -1;
704
705 int err = git_odb_backend_loose(&self->super.odb_backend, path, compression_level,
706 do_fsync, dir_mode, file_mode);
707 Py_DECREF(tvalue);
708 if (err) {
709 Error_set(err);
710 return -1;
711 }
712
713 return 0;
714}
715
716PyTypeObject OdbBackendLooseType = {
717 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…