Skip to content

Commit 3f14513

Browse files
lucianpostongitster
authored andcommitted
Adjust stat width calculations to take --graph output into account
The recent change to compute the width of diff --stat did not take into consideration the output from --graph. The consequence is that when both options are used, e.g. in 'log --stat --graph', the lines are too long. Adjust stat width calculations to take --graph output into account. Signed-off-by: Lucian Poston <lucian.poston@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 5e71a84 commit 3f14513

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
14451445
*/
14461446

14471447
if (options->stat_width == -1)
1448-
width = term_columns();
1448+
width = term_columns() - options->output_prefix_length;
14491449
else
14501450
width = options->stat_width ? options->stat_width : 80;
14511451

0 commit comments

Comments
 (0)