Skip to content

Commit 19b15ed

Browse files
committed
Provide Walker simplify_first_parent method
1 parent fafb4b9 commit 19b15ed

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/walker.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,18 @@ Walker_reset(Walker *self)
122122
Py_RETURN_NONE;
123123
}
124124

125+
PyDoc_STRVAR(Walker_simplify_first_parent__doc__,
126+
"simplify_first_parent()\n"
127+
"\n"
128+
"Simplify the history by first-parent.");
129+
130+
PyObject *
131+
Walker_simplify_first_parent(Walker *self)
132+
{
133+
git_revwalk_simplify_first_parent(self->walk);
134+
Py_RETURN_NONE;
135+
}
136+
125137
PyObject *
126138
Walker_iter(Walker *self)
127139
{
@@ -158,6 +170,7 @@ PyMethodDef Walker_methods[] = {
158170
METHOD(Walker, hide, METH_O),
159171
METHOD(Walker, push, METH_O),
160172
METHOD(Walker, reset, METH_NOARGS),
173+
METHOD(Walker, simplify_first_parent, METH_NOARGS),
161174
METHOD(Walker, sort, METH_O),
162175
{NULL}
163176
};

0 commit comments

Comments
 (0)