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

Function Object_short_id__get__

src/object.c:98–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 "An unambiguous short (abbreviated) hex Oid string for the object.");
97
98PyObject *
99Object_short_id__get__(Object *self)
100{
101 if (Object__load(self) == NULL) { return NULL; } // Lazy load
102
103 git_buf short_id = { NULL, 0, 0 };
104 int err = git_object_short_id(&short_id, self->obj);
105 if (err != GIT_OK)
106 return Error_set(err);
107
108 PyObject *py_short_id = to_unicode_n(short_id.ptr, short_id.size, NULL, "strict");
109 git_buf_dispose(&short_id);
110 return py_short_id;
111}
112
113
114PyDoc_STRVAR(Object_type__doc__,

Callers

nothing calls this directly

Calls 3

Object__loadFunction · 0.85
Error_setFunction · 0.85
to_unicode_nFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…