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

Function Tree_diff_to_workdir

src/tree.c:224–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222 " the hunks will be merged into a one.\n");
223
224PyObject *
225Tree_diff_to_workdir(Tree *self, PyObject *args, PyObject *kwds)
226{
227 git_diff_options opts = GIT_DIFF_OPTIONS_INIT;
228 git_diff *diff;
229 int err;
230
231 char *keywords[] = {"flags", "context_lines", "interhunk_lines", NULL};
232
233 if (!PyArg_ParseTupleAndKeywords(args, kwds, "|IHH", keywords, &opts.flags,
234 &opts.context_lines, &opts.interhunk_lines))
235 return NULL;
236
237 if (Object__load((Object*)self) == NULL) { return NULL; } // Lazy load
238
239 err = git_diff_tree_to_workdir(&diff, self->repo->repo, self->tree, &opts);
240 if (err < 0)
241 return Error_set(err);
242
243 return wrap_diff(diff, self->repo);
244}
245
246
247PyDoc_STRVAR(Tree_diff_to_index__doc__,

Callers

nothing calls this directly

Calls 3

Object__loadFunction · 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…