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

Function Patch_hunks__get__

src/patch.c:217–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215PyDoc_STRVAR(Patch_hunks__doc__, "hunks");
216
217PyObject *
218Patch_hunks__get__(Patch *self)
219{
220 size_t i, hunk_amounts;
221 PyObject *py_hunks;
222 PyObject *py_hunk;
223
224 hunk_amounts = git_patch_num_hunks(self->patch);
225 py_hunks = PyList_New(hunk_amounts);
226 for (i = 0; i < hunk_amounts; i++) {
227 py_hunk = wrap_diff_hunk(self, i);
228 if (py_hunk == NULL)
229 return NULL;
230
231 PyList_SET_ITEM((PyObject*) py_hunks, i, py_hunk);
232 }
233
234 return py_hunks;
235}
236
237
238static PyMethodDef Patch_methods[] = {

Callers

nothing calls this directly

Calls 1

wrap_diff_hunkFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…