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

Function Diff_from_c

src/diff.c:974–998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

972PyDoc_STRVAR(Diff_from_c__doc__, "Method exposed for Index to hook into");
973
974PyObject *
975Diff_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
1000PyDoc_STRVAR(Diff_merge__doc__,
1001 "merge(diff: Diff)\n"

Callers

nothing calls this directly

Calls 1

wrap_diffFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…