From 1f783c957e24323a97f34258040fac6f65b95657 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 5 Nov 2026 20:56:15 -1000 Subject: Name a pinned commit with the page in the title --- tests/t0005-markup.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index cf9143b..064e74d 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -118,6 +118,19 @@ test_expect_success 'each page names itself, then the repository and the site' ' grep "blame - hello.c < dir - hooks - $site" tmp ' +# A commit the page is pinned to belongs with the page's own name, or with the +# repository's on the summary, which has no name of its own. +test_expect_success 'a pinned page names its commit before the repository' ' + site="Git repository browser" && + old=$(git -C repos/hooks rev-parse HEAD~1 | cut -c1-10) && + cgit_rc hooksrc "url=hooks/tree/&id=$old" >tmp && + grep "tree @ $old - hooks - $site" tmp && + cgit_rc hooksrc "url=hooks/commit/&id=$old" >tmp && + grep "commit 2 @ $old - hooks - $site" tmp && + cgit_rc hooksrc "url=hooks/&id=$old" >tmp && + grep "hooks @ $old - $site" tmp +' + # The logo is all its link holds, so it is named for where the link leads, # which by default is the site's index. test_expect_success 'the logo is named after the site' ' -- cgit 2.12.1