Give access to the path of an index entry
This commit is contained in:
6
pygit2.c
6
pygit2.c
@@ -1741,6 +1741,11 @@ IndexEntry_dealloc(IndexEntry *self) {
|
|||||||
self->ob_type->tp_free((PyObject*)self);
|
self->ob_type->tp_free((PyObject*)self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *
|
||||||
|
IndexEntry_get_path(IndexEntry *self) {
|
||||||
|
return PyString_FromString(self->entry->path);
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
IndexEntry_get_sha(IndexEntry *self) {
|
IndexEntry_get_sha(IndexEntry *self) {
|
||||||
char hex[GIT_OID_HEXSZ];
|
char hex[GIT_OID_HEXSZ];
|
||||||
@@ -1750,6 +1755,7 @@ IndexEntry_get_sha(IndexEntry *self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PyGetSetDef IndexEntry_getseters[] = {
|
static PyGetSetDef IndexEntry_getseters[] = {
|
||||||
|
{"path", (getter)IndexEntry_get_path, NULL, "path", NULL},
|
||||||
{"sha", (getter)IndexEntry_get_sha, NULL, "hex SHA", NULL},
|
{"sha", (getter)IndexEntry_get_sha, NULL, "hex SHA", NULL},
|
||||||
{NULL},
|
{NULL},
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user