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

Function Repository_applies

src/repository.c:2264–2289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2262 );
2263
2264PyObject *
2265Repository_applies(Repository *self, PyObject *args, PyObject *kwds)
2266{
2267 Diff *py_diff;
2268 int location = GIT_APPLY_LOCATION_INDEX;
2269 int raise_error = 0;
2270 git_apply_options options = GIT_APPLY_OPTIONS_INIT;
2271 options.flags |= GIT_APPLY_CHECK;
2272
2273 char* keywords[] = {"diff", "location", "raise_error", NULL};
2274
2275 if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|ii", keywords,
2276 &DiffType, &py_diff,
2277 &location, &raise_error))
2278 return NULL;
2279
2280 int err = git_apply(self->repo, ((Diff*)py_diff)->diff, location, &options);
2281 if (err != 0) {
2282 if (raise_error)
2283 return Error_set(err);
2284 else
2285 Py_RETURN_FALSE;
2286 }
2287
2288 Py_RETURN_TRUE;
2289}
2290
2291PyDoc_STRVAR(Repository_set_odb__doc__,
2292 "set_odb(odb: Odb)\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…