| 141 | |
| 142 | PyDoc_STRVAR(Repository__from_c__doc__, "Init a Repository from a pointer. For internal use only."); |
| 143 | PyObject * |
| 144 | Repository__from_c(Repository *py_repo, PyObject *args) |
| 145 | { |
| 146 | PyObject *py_pointer, *py_free; |
| 147 | char *buffer; |
| 148 | Py_ssize_t len; |
| 149 | int err; |
| 150 | |
| 151 | py_repo->repo = NULL; |
| 152 | py_repo->config = NULL; |
| 153 | py_repo->index = NULL; |
| 154 | |
| 155 | if (!PyArg_ParseTuple(args, "OO!", &py_pointer, &PyBool_Type, &py_free)) |
| 156 | return NULL; |
| 157 | |
| 158 | err = PyBytes_AsStringAndSize(py_pointer, &buffer, &len); |
| 159 | if (err < 0) |
| 160 | return NULL; |
| 161 | |
| 162 | if (len != sizeof(git_repository *)) { |
| 163 | PyErr_SetString(PyExc_TypeError, "invalid pointer length"); |
| 164 | return NULL; |
| 165 | } |
| 166 | |
| 167 | py_repo->repo = *((git_repository **) buffer); |
| 168 | py_repo->owned = py_free == Py_True; |
| 169 | |
| 170 | Py_RETURN_NONE; |
| 171 | } |
| 172 | |
| 173 | PyDoc_STRVAR(Repository__disown__doc__, "Mark the object as not-owned by us. For internal use only."); |
| 174 | PyObject * |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…