From b41d3bca53f38a6610e77019692eb658a13acd0b Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 17 Oct 2026 12:53:15 -1000 Subject: Page a followed log by the name asked for Each row of a followed log moves ctx.qry.vpath to the name its commit knew the file by, and the pager built its links from that, so past a rename both links named the old file and led to an empty page. --- source/ui-log.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source/ui-log.c') diff --git a/source/ui-log.c b/source/ui-log.c index 8adc5ac..1ac9a77 100644 --- a/source/ui-log.c +++ b/source/ui-log.c @@ -367,9 +367,10 @@ static char *next_token(char **src) /* * Whether there is a page after this one is answered by pulling one more - * commit off the walk. + * commit off the walk. The links carry the path as it was asked for, since a + * followed rename leaves ctx.qry.vpath at the name the last row's commit knew. */ -static void print_pager(struct rev_info *revs, int ofs, int cnt) +static void print_pager(struct rev_info *revs, const char *path, int ofs, int cnt) { struct commit *more = get_revision(revs); @@ -381,7 +382,7 @@ static void print_pager(struct rev_info *revs, int ofs, int cnt) if (ofs > 0) { html("
  • "); cgit_log_link( - "[prev]", NULL, NULL, ctx.qry.head, ctx.qry.oid, ctx.qry.vpath, + "[prev]", NULL, NULL, ctx.qry.head, ctx.qry.oid, path, ofs - cnt, ctx.qry.grep, ctx.qry.search, ctx.qry.showmsg, ctx.qry.follow ); html("
  • "); @@ -389,7 +390,7 @@ static void print_pager(struct rev_info *revs, int ofs, int cnt) if (more) { html("
  • "); cgit_log_link( - "[next]", NULL, NULL, ctx.qry.head, ctx.qry.oid, ctx.qry.vpath, + "[next]", NULL, NULL, ctx.qry.head, ctx.qry.oid, path, ofs + cnt, ctx.qry.grep, ctx.qry.search, ctx.qry.showmsg, ctx.qry.follow ); html("
  • "); @@ -616,7 +617,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern commit->parents = NULL; } if (pager) { - print_pager(&rev, ofs, cnt); + print_pager(&rev, path, ofs, cnt); cgit_print_layout_end(); } else { if ((commit = get_revision(&rev))) { -- cgit