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

Function DiffFile_from_c

src/diff.c:189–209  ·  view source on GitHub ↗

Expose wrap_diff_file to python so we can call it in callbacks.py. */

Source from the content-addressed store, hash-verified

187
188/* Expose wrap_diff_file to python so we can call it in callbacks.py. */
189PyObject *
190DiffFile_from_c(DiffFile *dummy, PyObject *py_diff_file_ptr)
191{
192 const git_diff_file *diff_file;
193 char *buffer;
194 Py_ssize_t length;
195
196 /* Here we need to do the opposite conversion from the _pointer getters */
197 if (PyBytes_AsStringAndSize(py_diff_file_ptr, &buffer, &length))
198 return NULL;
199
200 if (length != sizeof(git_diff_file *)) {
201 PyErr_SetString(PyExc_TypeError, "passed value is not a pointer");
202 return NULL;
203 }
204
205 /* the "buffer" contains the pointer */
206 diff_file = *((const git_diff_file **) buffer);
207
208 return wrap_diff_file(diff_file);
209}
210
211PyDoc_STRVAR(DiffFile_flags__doc__,
212 "A combination of enums.DiffFlag constants."

Callers

nothing calls this directly

Calls 1

wrap_diff_fileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…