Merge branch 'zj/mksh-columns-breakage' into lp/diffstat-with-graph
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 0b61cf7c7f2b682df09360e059958bfca12f459a..f08b41a663fe24a6b2cad51c0edcedff81fe7d2b 100644 (file)
--- 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;