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

Function pgit_odb_backend_write

src/odb_backend.c:157–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157static int
158pgit_odb_backend_write(git_odb_backend *_be, const git_oid *oid,
159 const void *data, size_t sz, git_object_t typ)
160{
161 pgit_odb_backend *be = (pgit_odb_backend *)_be;
162
163 PyObject *py_oid = git_oid_to_python(oid);
164 if (py_oid == NULL)
165 return GIT_EUSER;
166
167 PyObject *result = PyObject_CallMethod(be->py_backend, "write_cb", "Ny#n", py_oid, data, sz, typ);
168 if (result == NULL)
169 return git_error_for_exc();
170
171 Py_DECREF(result);
172 return 0;
173}
174
175static int
176pgit_odb_backend_exists(git_odb_backend *_be, const git_oid *oid)

Callers

nothing calls this directly

Calls 2

git_oid_to_pythonFunction · 0.85
git_error_for_excFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…