| 683 | " mode for new files, or 0 for default"); |
| 684 | |
| 685 | int |
| 686 | OdbBackendLoose_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 | |
| 716 | PyTypeObject OdbBackendLooseType = { |
| 717 | PyVarObject_HEAD_INIT(NULL, 0) |
nothing calls this directly
no test coverage detected
searching dependent graphs…