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

Function Repository_apply

src/repository.c:2224–2243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2222 );
2223
2224PyObject *
2225Repository_apply(Repository *self, PyObject *args, PyObject *kwds)
2226{
2227 Diff *py_diff;
2228 int location = GIT_APPLY_LOCATION_WORKDIR;
2229 git_apply_options options = GIT_APPLY_OPTIONS_INIT;
2230
2231 char* keywords[] = {"diff", "location", NULL};
2232
2233 if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|i", keywords,
2234 &DiffType, &py_diff,
2235 &location))
2236 return NULL;
2237
2238 int err = git_apply(self->repo, py_diff->diff, location, &options);
2239 if (err != 0)
2240 return Error_set(err);
2241
2242 Py_RETURN_NONE;
2243}
2244
2245PyDoc_STRVAR(Repository_applies__doc__,
2246 "applies(diff: Diff, location: int = GIT_APPLY_LOCATION_INDEX, raise_error: bool = False) -> bool\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…