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

Function OdbBackend_exists

src/odb_backend.c:449–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447 "Returns true if the given oid can be found in this odb.");
448
449PyObject *
450OdbBackend_exists(OdbBackend *self, PyObject *py_hex)
451{
452 int result;
453 size_t len;
454 git_oid oid;
455
456 if (self->odb_backend->exists == NULL)
457 Py_RETURN_NOTIMPLEMENTED;
458
459 len = py_oid_to_git_oid(py_hex, &oid);
460 if (len == 0)
461 return NULL;
462
463 result = self->odb_backend->exists(self->odb_backend, &oid);
464 if (result < 0)
465 return Error_set(result);
466 else if (result == 0)
467 Py_RETURN_FALSE;
468 else
469 Py_RETURN_TRUE;
470}
471
472PyDoc_STRVAR(OdbBackend_exists_prefix__doc__,
473 "exists_prefix(partial_id: Oid) -> Oid\n"

Callers

nothing calls this directly

Calls 3

py_oid_to_git_oidFunction · 0.85
Error_setFunction · 0.85
existsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…