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

Function Diff_parse_diff

src/diff.c:1098–1113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1096 "Parses a git unified diff into a diff object without a repository");
1097
1098static PyObject *
1099Diff_parse_diff(PyObject *self, PyObject *py_str)
1100{
1101 /* A wrapper around git_diff_from_buffer */
1102 git_diff *diff;
1103
1104 const char *content = pgit_borrow(py_str);
1105 if (content == NULL)
1106 return NULL;
1107
1108 int err = git_diff_from_buffer(&diff, content, strlen(content));
1109 if (err < 0)
1110 return Error_set(err);
1111
1112 return wrap_diff(diff, NULL);
1113}
1114
1115static void
1116Diff_dealloc(Diff *self)

Callers

nothing calls this directly

Calls 3

pgit_borrowFunction · 0.85
Error_setFunction · 0.85
wrap_diffFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…