From 678c5741118729dc9072182bd368e0a3402dd4f1 Mon Sep 17 00:00:00 2001 From: Lucian Poston Date: Wed, 18 Apr 2012 14:12:18 -0700 Subject: Prevent graph_width of stat width from falling below min Update tests in t4052 fixed by this change. Signed-off-by: Lucian Poston Signed-off-by: Junio C Hamano --- diff.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'diff.c') diff --git a/diff.c b/diff.c index 0b61cf7c7f..f08b41a663 100644 --- a/diff.c +++ b/diff.c @@ -1473,8 +1473,12 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options) * Adjust adjustable widths not to exceed maximum width */ if (name_width + number_width + 6 + graph_width > width) { - if (graph_width > width * 3/8 - number_width - 6) + if (graph_width > width * 3/8 - number_width - 6) { graph_width = width * 3/8 - number_width - 6; + if (graph_width < 6) + graph_width = 6; + } + if (options->stat_graph_width && graph_width > options->stat_graph_width) graph_width = options->stat_graph_width; -- cgit v1.2.3