Code

log --stat: use the full terminal width
[git.git] / diff.c
diff --git a/diff.c b/diff.c
index e0590a305655b6da3c5903875b3f2080f47a57c7..74782770bc7068cb3ca7f4dd69ab1045bfdcfa5e 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1343,7 +1343,10 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
                line_prefix = msg->buf;
        }
 
-       width = options->stat_width ? options->stat_width : 80;
+       if (options->stat_width == -1)
+               width = term_columns();
+       else
+               width = options->stat_width ? options->stat_width : 80;
        name_width = options->stat_name_width ? options->stat_name_width : 50;
        count = options->stat_count ? options->stat_count : data->nr;