From 1f09d1bddebe6574a2b6977bf9bf7c614588a4e4 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 12:57:49 -1000 Subject: Test the link from a tag to the tag it tags A robustness test asked for the inner tag's page by id, but nothing checked that the outer tag's page links there. --- tests/t0113-tag.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/t0113-tag.sh b/tests/t0113-tag.sh index 0fec8b6..b6fd980 100755 --- a/tests/t0113-tag.sh +++ b/tests/t0113-tag.sh @@ -54,6 +54,20 @@ test_expect_success 'a name that is no tag is a 404' ' test_grep "
Bad tag reference: no-such-tag
" tmp ' +# No ref names the inner tag of a tag of a tag, so the outer tag's page links +# it by its id, which the tag page has to answer. +test_expect_success 'a tag of a tag links the inner tag' ' + git -C repos/foo tag -a -m inner inner-tag HEAD && + git -C repos/foo -c advice.nestedTag=false tag -a -m outer outer-tag inner-tag && + inner=$(git -C repos/foo rev-parse inner-tag) && + commit=$(git -C repos/foo rev-parse inner-tag^{commit}) && + cgit_ok_url "foo/tag/&h=outer-tag" >tmp && + test_grep "tagged objecttag $inner" tmp && + cgit_ok_url "foo/tag/&h=outer-tag&id=$inner" >tmp && + test_grep "tag name$inner ($inner)" tmp && + test_grep "commit $commit" tmp +' + # A snapshot is cut from a commit, so a tag of a tree or a blob offers none. test_expect_success 'a tag of anything but a commit offers no download' ' git -C repos/foo tag -a -m "a tree" tree-tag HEAD^{tree} && -- cgit 2.12.1