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

Function pgit_odb_backend_read_header

src/odb_backend.c:132–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132static int
133pgit_odb_backend_read_header(size_t *len, git_object_t *type,
134 git_odb_backend *_be, const git_oid *oid)
135{
136 pgit_odb_backend *be = (pgit_odb_backend *)_be;
137
138 PyObject *py_oid = git_oid_to_python(oid);
139 if (py_oid == NULL)
140 return GIT_EUSER;
141
142 PyObject *result = PyObject_CallMethod(be->py_backend, "read_header_cb", "N", py_oid);
143 if (result == NULL)
144 return git_error_for_exc();
145
146 Py_ssize_t type_value;
147 if (!PyArg_ParseTuple(result, "nn", &type_value, len)) {
148 Py_DECREF(result);
149 return GIT_EUSER;
150 }
151 *type = (git_object_t)type_value;
152
153 Py_DECREF(result);
154 return 0;
155}
156
157static int
158pgit_odb_backend_write(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…