Diff options
| -rwxr-xr-x | tests/t0113-tag.sh | 14 |
1 file changed, 14 insertions, 0 deletions
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 "<div class=.error.>Bad tag reference: no-such-tag</div>" 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 "<tr><th scope=.row.>tagged object</th><td class=.oid.><a href=./foo/tag/?h=outer-tag&id=$inner.>tag $inner</a></td></tr>" tmp && + cgit_ok_url "foo/tag/&h=outer-tag&id=$inner" >tmp && + test_grep "<tr><th scope=.row.>tag name</th><td>$inner (<span class=.oid.>$inner</span>)</td></tr>" tmp && + test_grep "<a href=./foo/commit/?h=outer-tag&id=$commit.>commit $commit</a>" 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} && |
