diff options
author | Lucian Poston <lucian.poston@gmail.com> | 2012-04-18 14:12:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-18 16:08:11 -0700 |
commit | 678c5741118729dc9072182bd368e0a3402dd4f1 (patch) | |
tree | 5137d5f232a213f9eeee1cafb73a5c41cb10f1e8 /diff.c | |
parent | t4052: Test diff-stat output with minimum columns (diff) | |
download | tgif-678c5741118729dc9072182bd368e0a3402dd4f1.tar.xz |
Prevent graph_width of stat width from falling below min
Update tests in t4052 fixed by this change.
Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |