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

Function diff_get_patch_byindex

src/diff.c:526–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524};
525
526PyObject *
527diff_get_patch_byindex(git_diff *diff, size_t idx)
528{
529 git_patch *patch = NULL;
530 int err;
531
532 err = git_patch_from_diff(&patch, diff, idx);
533 if (err < 0)
534 return Error_set(err);
535
536 /* libgit2 may decide not to create a patch if the file is
537 "unchanged or binary", but this isn't an error case */
538 if (patch == NULL)
539 Py_RETURN_NONE;
540
541 return (PyObject*) wrap_patch(patch, NULL, NULL);
542}
543
544PyObject *
545DiffIter_iternext(DiffIter *self)

Callers 2

DiffIter_iternextFunction · 0.85
Diff_getitemFunction · 0.85

Calls 2

Error_setFunction · 0.85
wrap_patchFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…