Py_hash_t Oid_hash(PyObject *oid) { PyObject *py_oid = git_oid_to_py_str(&((Oid *)oid)->oid); Py_hash_t ret = PyObject_Hash(py_oid); Py_DECREF(py_oid); return ret; }
Py_hash_t Object_hash(Object *object) { const git_oid *oid = git_object_id(object->obj); PyObject *py_oid = git_oid_to_py_str(oid); Py_hash_t ret = PyObject_Hash(py_oid); Py_DECREF(py_oid); return ret; }
static int Repository_build_as_iter(const git_oid *oid, void *accum) { int err; PyObject *oid_str = git_oid_to_py_str(oid); err = PyList_Append((PyObject*)accum, oid_str); Py_DECREF(oid_str); return err; }
PyObject * Object_hex__get__(Object *self) { const git_oid *oid; oid = git_object_id(self->obj); assert(oid); return git_oid_to_py_str(oid); }
PyObject * Reference_hex__get__(Reference *self) { const git_oid *oid; CHECK_REFERENCE(self); /* Get the oid (only for "direct" references) */ oid = git_reference_target(self->reference); if (oid == NULL) { PyErr_SetString(PyExc_ValueError, "oid is only available if the reference is direct " "(i.e. not symbolic)"); return NULL; } /* Convert and return it */ return git_oid_to_py_str(oid); }
PyObject * Reference_target__get__(Reference *self) { const char * c_name; CHECK_REFERENCE(self); /* Get the target */ if (GIT_REF_OID == git_reference_type(self->reference)) { return git_oid_to_py_str(git_reference_target(self->reference)); } else { c_name = git_reference_symbolic_target(self->reference); if (c_name == NULL) { PyErr_SetString(PyExc_ValueError, "no target available"); return NULL; } } /* Make a PyString and return it */ return to_path(c_name); }
PyObject * TreeEntry_hex__get__(TreeEntry *self) { return git_oid_to_py_str(git_tree_entry_id(self->entry)); }
PyObject * IndexEntry_hex__get__(IndexEntry *self) { return git_oid_to_py_str(&self->entry.oid); }
PyObject * IndexEntry_get_hex(IndexEntry *self) { return git_oid_to_py_str(&self->entry->oid); }
PyObject * Oid_hex__get__(Oid *self) { return git_oid_to_py_str(&self->oid); }
PyObject * Oid__str__(Oid *self) { return git_oid_to_py_str(&self->oid); }