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

Function Repository_git_object_lookup_prefix

src/repository.c:303–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301 "Returns the Git object with the given oid.");
302
303PyObject *
304Repository_git_object_lookup_prefix(Repository *self, PyObject *key)
305{
306 int err;
307 size_t len;
308 git_oid oid;
309 git_object *obj;
310
311 len = py_oid_to_git_oid(key, &oid);
312 if (len == 0)
313 return NULL;
314
315 err = git_object_lookup_prefix(&obj, self->repo, &oid, len, GIT_OBJECT_ANY);
316 if (err == 0)
317 return wrap_object(obj, self, NULL);
318
319 if (err == GIT_ENOTFOUND)
320 Py_RETURN_NONE;
321
322 return Error_set_oid(err, &oid, len);
323}
324
325
326PyDoc_STRVAR(Repository_lookup_branch__doc__,

Callers

nothing calls this directly

Calls 3

py_oid_to_git_oidFunction · 0.85
wrap_objectFunction · 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…