From b389d37db07358335ffbe1180fed138bf81fa512 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 12:20:05 -1000 Subject: Follow the blame page's crumb and previous links Both fixes were for links that led to a 404, and the tests read the href without asking for the page it names. --- tests/t0104-tree.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 607065b..5df20b2 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -110,7 +110,11 @@ test_expect_success 'the folder crumbs of a blame page lead to the tree' ' ) && cgitrc_repo nestedrc nested enable-blame=1 && cgit_ok nestedrc "url=nested/blame/a/b/file.txt" >tmp && - grep "path: root/a/b/file.txt" tmp + grep "path: root/a/b/file.txt" tmp && + cgit_ok nestedrc "url=nested/tree/a" >tmp && + test_grep "href=./nested/tree/a/b.>b" tmp && + cgit_ok nestedrc "url=nested/tree/a/b" >tmp && + test_grep "href=./nested/tree/a/b/file.txt.>file.txt" tmp ' # A commit's lines link to the file as the parent had it, under the name it @@ -131,7 +135,10 @@ test_expect_success 'blame links a commit to the file before it' ' cgit_ok renamedrc "url=renamed/blame/b.txt" >tmp && added=$(git -C repos/renamed rev-parse HEAD~1) && grep "title=.Blame the previous revision. href=./renamed/blame/a.txt?id=$added.>^" tmp && - test $(grep -c "Blame the previous revision" tmp) = 1 + test $(grep -c "Blame the previous revision" tmp) = 1 && + cgit_ok renamedrc "url=renamed/blame/a.txt&id=$added" >tmp && + test_grep "plain" tmp && + test_grep "" tmp ' test_expect_success 'generate foo+bar/tree' 'cgit_ok_url "foo%2bbar/tree" >tmp' -- cgit 2.12.1