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

Function Diff_patch__get__

src/diff.c:699–712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

697 "Patch diff string. Can be None in some cases, such as empty commits.");
698
699PyObject *
700Diff_patch__get__(Diff *self)
701{
702 git_buf buf = {NULL};
703
704 int err = git_diff_to_buf(&buf, self->diff, GIT_DIFF_FORMAT_PATCH);
705 if (err < 0)
706 return Error_set(err);
707
708 PyObject *py_patch = to_unicode_n(buf.ptr, buf.size, NULL, NULL);
709
710 git_buf_dispose(&buf);
711 return py_patch;
712}
713
714
715static void

Callers

nothing calls this directly

Calls 2

Error_setFunction · 0.85
to_unicode_nFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…