| 972 | PyDoc_STRVAR(Diff_from_c__doc__, "Method exposed for Index to hook into"); |
| 973 | |
| 974 | PyObject * |
| 975 | Diff_from_c(Diff *dummy, PyObject *args) |
| 976 | { |
| 977 | PyObject *py_diff, *py_repository; |
| 978 | git_diff *diff; |
| 979 | char *buffer; |
| 980 | Py_ssize_t length; |
| 981 | |
| 982 | if (!PyArg_ParseTuple(args, "OO!", &py_diff, &RepositoryType, &py_repository)) |
| 983 | return NULL; |
| 984 | |
| 985 | /* Here we need to do the opposite conversion from the _pointer getters */ |
| 986 | if (PyBytes_AsStringAndSize(py_diff, &buffer, &length)) |
| 987 | return NULL; |
| 988 | |
| 989 | if (length != sizeof(git_diff *)) { |
| 990 | PyErr_SetString(PyExc_TypeError, "passed value is not a pointer"); |
| 991 | return NULL; |
| 992 | } |
| 993 | |
| 994 | /* the "buffer" contains the pointer */ |
| 995 | diff = *((git_diff **) buffer); |
| 996 | |
| 997 | return wrap_diff(diff, (Repository *) py_repository); |
| 998 | } |
| 999 | |
| 1000 | PyDoc_STRVAR(Diff_merge__doc__, |
| 1001 | "merge(diff: Diff)\n" |
nothing calls this directly
no test coverage detected
searching dependent graphs…