| 881 | " The width of the output. The output will be scaled to fit."); |
| 882 | |
| 883 | PyObject * |
| 884 | DiffStats_format(DiffStats *self, PyObject *args, PyObject *kwds) |
| 885 | { |
| 886 | int err, format; |
| 887 | git_buf buf = { 0 }; |
| 888 | Py_ssize_t width; |
| 889 | PyObject *str; |
| 890 | char *keywords[] = {"format", "width", NULL}; |
| 891 | |
| 892 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "in", keywords, &format, &width)) |
| 893 | return NULL; |
| 894 | |
| 895 | if (width <= 0) { |
| 896 | PyErr_SetString(PyExc_ValueError, "width must be positive"); |
| 897 | return NULL; |
| 898 | } |
| 899 | |
| 900 | err = git_diff_stats_to_buf(&buf, self->stats, format, width); |
| 901 | if (err < 0) |
| 902 | return Error_set(err); |
| 903 | |
| 904 | str = to_unicode_n(buf.ptr, buf.size, NULL, NULL); |
| 905 | git_buf_dispose(&buf); |
| 906 | |
| 907 | return str; |
| 908 | } |
| 909 | |
| 910 | static void |
| 911 | DiffStats_dealloc(DiffStats *self) |
nothing calls this directly
no test coverage detected
searching dependent graphs…