From 819191dad896b765d4a71a4e94d4d664cb8ee107 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 19:25:14 -1000 Subject: Show a full index page for a negative offset The query parser takes an offset as low as -1, which the stats page reads as every author, so the index clamps it for itself, as the log and refs pages already do. --- source/ui-repolist.c | 5 +++++ tests/t0101-index.sh | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/source/ui-repolist.c b/source/ui-repolist.c index 4f79f70..800373e 100644 --- a/source/ui-repolist.c +++ b/source/ui-repolist.c @@ -442,6 +442,11 @@ void cgit_print_repolist(void) else if (ctx.cfg.section_sort) sort_repolist("section"); + // An offset of -1 gets through for the stats page, where it means + // every author, and would start this page a row before the first. + if (ctx.qry.ofs < 0) + ctx.qry.ofs = 0; + currenturl = cgit_currenturl(); html("\n"); for (i = 0; i < cgit_repolist.count; i++) { diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index d3d4469..1fcd615 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -146,6 +146,24 @@ test_expect_success 'the idle column shows the date the age file holds' ' test_grep "