| 54 | } |
| 55 | |
| 56 | int |
| 57 | Odb_init(Odb *self, PyObject *args, PyObject *kwds) |
| 58 | { |
| 59 | if (kwds && PyDict_Size(kwds) > 0) { |
| 60 | PyErr_SetString(PyExc_TypeError, "Odb takes no keyword arguments"); |
| 61 | return -1; |
| 62 | } |
| 63 | |
| 64 | PyObject *py_path = NULL; |
| 65 | if (!PyArg_ParseTuple(args, "|O", &py_path)) |
| 66 | return -1; |
| 67 | |
| 68 | int err; |
| 69 | if (py_path) { |
| 70 | PyObject *tvalue; |
| 71 | char *path = pgit_borrow_fsdefault(py_path, &tvalue); |
| 72 | if (path == NULL) |
| 73 | return -1; |
| 74 | err = git_odb_open(&self->odb, path); |
| 75 | Py_DECREF(tvalue); |
| 76 | } |
| 77 | else { |
| 78 | err = git_odb_new(&self->odb); |
| 79 | } |
| 80 | |
| 81 | if (err) { |
| 82 | Error_set(err); |
| 83 | return -1; |
| 84 | } |
| 85 | |
| 86 | return 0; |
| 87 | } |
| 88 | |
| 89 | void |
| 90 | Odb_dealloc(Odb *self) |
nothing calls this directly
no test coverage detected
searching dependent graphs…