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. --- tests/t0103-log.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/t0103-log.sh b/tests/t0103-log.sh index 08f9ddd..ed92a76 100755 --- a/tests/t0103-log.sh +++ b/tests/t0103-log.sh @@ -46,7 +46,8 @@ test_expect_success 'no links with space in arg' '! grep "q=commit 1" tmp' test_expect_success 'commit 2 is not visible' '! grep "commit 2" tmp' # Following a file diffs each commit for the name the file had there, so the -# root commit that created it has to be diffed too. +# root commit that created it has to be diffed too, and paging has to go on +# asking about the name the visitor followed rather than the older one. test_expect_success 'set up a renamed file to follow' ' test_create_repo repos/fol && ( @@ -83,4 +84,11 @@ test_expect_success 'a followed log reaches the root commit' ' grep ">create a<" tmp ' +test_expect_success 'the pager of a followed log keeps the name followed' ' + CGIT_CONFIG="$PWD/folrc" QUERY_STRING="url=fol/log/b.txt&follow=1&ofs=3" cgit >tmp && + grep ">edit a 3<" tmp && + grep "href=./fol/log/b.txt?follow=1.>\[prev\]" tmp && + grep "href=./fol/log/b.txt?ofs=6&follow=1.>\[next\]" tmp +' + test_done -- cgit