| 114 | } |
| 115 | |
| 116 | PyObject * |
| 117 | wrap_diff_hunk(Patch *patch, size_t idx) |
| 118 | { |
| 119 | DiffHunk *py_hunk; |
| 120 | const git_diff_hunk *hunk; |
| 121 | size_t lines_in_hunk; |
| 122 | int err; |
| 123 | |
| 124 | err = git_patch_get_hunk(&hunk, &lines_in_hunk, patch->patch, idx); |
| 125 | if (err < 0) |
| 126 | return Error_set(err); |
| 127 | |
| 128 | py_hunk = PyObject_New(DiffHunk, &DiffHunkType); |
| 129 | if (py_hunk) { |
| 130 | Py_INCREF(patch); |
| 131 | py_hunk->patch = patch; |
| 132 | py_hunk->hunk = hunk; |
| 133 | py_hunk->idx = idx; |
| 134 | py_hunk->n_lines = lines_in_hunk; |
| 135 | } |
| 136 | |
| 137 | return (PyObject *) py_hunk; |
| 138 | } |
| 139 | |
| 140 | PyObject * |
| 141 | wrap_diff_stats(git_diff *diff) |
no test coverage detected
searching dependent graphs…