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

Function pgit_odb_backend_exists_prefix

src/odb_backend.c:193–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193static int
194pgit_odb_backend_exists_prefix(git_oid *out, git_odb_backend *_be,
195 const git_oid *short_id, size_t len)
196{
197 // short_id to hex
198 char short_id_hex[GIT_OID_HEXSZ];
199 git_oid_nfmt(short_id_hex, len, short_id);
200
201 // Call callback
202 pgit_odb_backend *be = (pgit_odb_backend *)_be;
203 PyObject *py_oid = PyObject_CallMethod(be->py_backend, "exists_prefix_cb", "s#", short_id_hex, len);
204 if (py_oid == NULL)
205 return git_error_for_exc();
206
207 py_oid_to_git_oid(py_oid, out);
208 Py_DECREF(py_oid);
209 return 0;
210}
211
212static int
213pgit_odb_backend_refresh(git_odb_backend *_be)

Callers

nothing calls this directly

Calls 2

git_error_for_excFunction · 0.85
py_oid_to_git_oidFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…