Adding a new 'mode' attribute to IndexEntry objects.
This new attribute gives use read access on IndexEntry's mode.
This commit is contained in:
6
pygit2.c
6
pygit2.c
@@ -1831,6 +1831,11 @@ IndexEntry_dealloc(IndexEntry *self) {
|
|||||||
self->ob_type->tp_free((PyObject*)self);
|
self->ob_type->tp_free((PyObject*)self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *
|
||||||
|
IndexEntry_get_mode(IndexEntry *self) {
|
||||||
|
return PyInt_FromLong(self->entry->mode);
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
IndexEntry_get_path(IndexEntry *self) {
|
IndexEntry_get_path(IndexEntry *self) {
|
||||||
return PyString_FromString(self->entry->path);
|
return PyString_FromString(self->entry->path);
|
||||||
@@ -1845,6 +1850,7 @@ IndexEntry_get_sha(IndexEntry *self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static PyGetSetDef IndexEntry_getseters[] = {
|
static PyGetSetDef IndexEntry_getseters[] = {
|
||||||
|
{"mode", (getter)IndexEntry_get_mode, NULL, "mode", NULL},
|
||||||
{"path", (getter)IndexEntry_get_path, NULL, "path", NULL},
|
{"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