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

Function Patch_data__get__

src/patch.c:175–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173PyDoc_STRVAR(Patch_data__doc__, "The raw bytes of the patch's contents.");
174
175PyObject *
176Patch_data__get__(Patch *self)
177{
178 git_buf buf = {NULL};
179 int err;
180 PyObject *bytes;
181
182 assert(self->patch);
183 err = git_patch_to_buf(&buf, self->patch);
184 if (err < 0)
185 return Error_set(err);
186
187 bytes = PyBytes_FromStringAndSize(buf.ptr, buf.size);
188 git_buf_dispose(&buf);
189 return bytes;
190}
191
192PyDoc_STRVAR(Patch_text__doc__,
193 "Patch diff string. Can be None in some cases, such as empty commits.\n"

Callers

nothing calls this directly

Calls 1

Error_setFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…