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

Function OdbBackend_read_header

src/odb_backend.c:420–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418 "Read raw object header from this odb backend.");
419
420PyObject *
421OdbBackend_read_header(OdbBackend *self, PyObject *py_hex)
422{
423 int err;
424 size_t len;
425 git_object_t type;
426 git_oid oid;
427
428 if (self->odb_backend->read_header == NULL)
429 Py_RETURN_NOTIMPLEMENTED;
430
431 len = py_oid_to_git_oid(py_hex, &oid);
432 if (len == 0)
433 return NULL;
434
435 err = self->odb_backend->read_header(&len, &type, self->odb_backend, &oid);
436 if (err != 0) {
437 Error_set_oid(err, &oid, len);
438 return NULL;
439 }
440
441 return Py_BuildValue("(ni)", type, len);
442}
443
444PyDoc_STRVAR(OdbBackend_exists__doc__,
445 "exists(oid: Oid) -> bool\n"

Callers

nothing calls this directly

Calls 2

py_oid_to_git_oidFunction · 0.85
Error_set_oidFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…