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

Function Object_read_raw

src/object.c:180–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 "Returns the byte string with the raw contents of the object.");
179
180PyObject *
181Object_read_raw(Object *self)
182{
183 int err;
184 git_odb *odb;
185 PyObject *aux;
186
187 err = git_repository_odb(&odb, self->repo->repo);
188 if (err < 0)
189 return Error_set(err);
190
191 const git_oid *oid = Object__id(self);
192 git_odb_object *obj = Odb_read_raw(odb, oid, GIT_OID_HEXSZ);
193 git_odb_free(odb);
194 if (obj == NULL)
195 return NULL;
196
197 aux = PyBytes_FromStringAndSize(
198 git_odb_object_data(obj),
199 git_odb_object_size(obj));
200
201 git_odb_object_free(obj);
202 return aux;
203}
204
205PyDoc_STRVAR(Object_peel__doc__,
206 "peel(target_type) -> Object\n"

Callers

nothing calls this directly

Calls 3

Error_setFunction · 0.85
Object__idFunction · 0.85
Odb_read_rawFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…