From e77e6527eb0f3084498bec77cc13f9e1500218af Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 14:03:20 -0700 Subject: Count the log's columns in ui-log.c alone --- source/ui-log.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'source/ui-log.c') diff --git a/source/ui-log.c b/source/ui-log.c index 1864d6f..f0ec203 100644 --- a/source/ui-log.c +++ b/source/ui-log.c @@ -442,6 +442,17 @@ void cgit_print_commit_decorations(struct commit *commit) html(""); } +int cgit_log_columns(int graph) +{ + int columns = graph ? 4 : 3; + + if (ctx.repo->enable_log_filecount) + columns++; + if (ctx.repo->enable_log_linecount) + columns++; + return columns; +} + void cgit_print_log(const char *tip, int ofs, int cnt, const char *grep, const char *pattern, const char *path, int pager, int commit_graph, int commit_sort, int table_columns) { @@ -531,11 +542,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, const char *grep, const c // A followed log is walked without the graph even when commit_graph // asks for one, so the walk decides the columns. - columns = rev.graph ? 4 : 3; - if (ctx.repo->enable_log_filecount) - columns++; - if (ctx.repo->enable_log_linecount) - columns++; + columns = cgit_log_columns(rev.graph != NULL); if (table_columns > columns) filler = table_columns - columns; -- cgit