Adding a new 'mode' attribute to IndexEntry objects.
This new attribute gives use read access on IndexEntry's mode.
This commit is contained in:
parent
9740fc44cd
commit
d484edb293
6
pygit2.c
6
pygit2.c
@ -1831,6 +1831,11 @@ IndexEntry_dealloc(IndexEntry *self) {
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
IndexEntry_get_mode(IndexEntry *self) {
|
||||
return PyInt_FromLong(self->entry->mode);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
IndexEntry_get_path(IndexEntry *self) {
|
||||
return PyString_FromString(self->entry->path);
|
||||
@ -1845,6 +1850,7 @@ IndexEntry_get_sha(IndexEntry *self) {
|
||||
}
|
||||
|
||||
static PyGetSetDef IndexEntry_getseters[] = {
|
||||
{"mode", (getter)IndexEntry_get_mode, NULL, "mode", NULL},
|
||||
{"path", (getter)IndexEntry_get_path, NULL, "path", NULL},
|
||||
{"sha", (getter)IndexEntry_get_sha, NULL, "hex SHA", NULL},
|
||||
{NULL},
|
||||
|
Loading…
x
Reference in New Issue
Block a user