| 763 | PyDoc_STRVAR(DiffHunk_lines__doc__, "Lines."); |
| 764 | |
| 765 | PyObject * |
| 766 | DiffHunk_lines__get__(DiffHunk *self) |
| 767 | { |
| 768 | PyObject *py_lines; |
| 769 | PyObject *py_line; |
| 770 | const git_diff_line *line; |
| 771 | size_t i; |
| 772 | int err; |
| 773 | |
| 774 | // TODO Replace by an iterator |
| 775 | py_lines = PyList_New(self->n_lines); |
| 776 | for (i = 0; i < self->n_lines; ++i) { |
| 777 | err = git_patch_get_line_in_hunk(&line, self->patch->patch, self->idx, i); |
| 778 | if (err < 0) |
| 779 | return Error_set(err); |
| 780 | |
| 781 | py_line = wrap_diff_line(line, self); |
| 782 | if (py_line == NULL) |
| 783 | return NULL; |
| 784 | |
| 785 | PyList_SetItem(py_lines, i, py_line); |
| 786 | } |
| 787 | return py_lines; |
| 788 | } |
| 789 | |
| 790 | |
| 791 | PyGetSetDef DiffHunk_getsetters[] = { |
nothing calls this directly
no test coverage detected
searching dependent graphs…