From dc87c1edb8b6f47fdab7839a0082d193a6f610f1 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 17 Oct 2026 12:53:14 -1000 Subject: Peel an annotated tag before looking for a readme Tag links carry the tag name as the head, so on any page reached from an annotated tag the about tab vanished and the about page redirected to the summary. --- tests/t0303-robustness.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index 2e0e849..da5e209 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -639,6 +639,20 @@ test_expect_success 'the about redirect keeps the query string' ' grep "^Status: 200" tmp ' +# A readme named without a branch is read from the head being browsed, and an +# annotated tag reaches its commit only through the tag object. +test_expect_success 'the readme follows an annotated tag as the head' ' + git -C repos/rob tag -a -m release v1 HEAD && + { + cat robrc && + echo "repo.readme=:file-1" + } >tagreadmerc && + CGIT_CONFIG="$PWD/tagreadmerc" QUERY_STRING="url=rob/about/&h=v1" cgit >tmp && + grep "^Status: 200" tmp && + CGIT_CONFIG="$PWD/tagreadmerc" QUERY_STRING="url=rob/tree/&h=v1" cgit >tmp && + grep ">about<" tmp +' + test_expect_success 'the about redirect encodes the repository url once' ' cgit_url "foo%2Bbar/about/" >tmp && grep "^Status: 302" tmp && -- cgit