| 447 | "Returns true if the given oid can be found in this odb."); |
| 448 | |
| 449 | PyObject * |
| 450 | OdbBackend_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 | |
| 472 | PyDoc_STRVAR(OdbBackend_exists_prefix__doc__, |
| 473 | "exists_prefix(partial_id: Oid) -> Oid\n" |
nothing calls this directly
no test coverage detected
searching dependent graphs…