Diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0113-tag.sh | 21 |
1 file changed, 21 insertions, 0 deletions
diff --git a/tests/t0113-tag.sh b/tests/t0113-tag.sh index b6fd980..209d039 100755 --- a/tests/t0113-tag.sh +++ b/tests/t0113-tag.sh @@ -106,6 +106,27 @@ test_expect_success 'a signed tag shows its signature in the message' ' grep "<div class=.commit-msg.>Notes.-----BEGIN PGP SIGNATURE-----iQEzBAABCAAdFiEE-----END PGP SIGNATURE-----</div>" flat ' +# A tag carries no encoding header, so its text is taken as UTF-8, and a byte +# that is not has a question mark put in its place on a page declared UTF-8. +test_expect_success 'a tag has its stray bytes replaced' ' + ( + cd repos/foo && + { + echo "object $(git rev-parse HEAD)" && + echo "type commit" && + echo "tag latin" && + printf "tagger C\\351 Mitter <committer@example.com> 1700000000 +0000\\n" && + echo && + printf "caf\\351 release\\n" + } >latin-tag && + git update-ref refs/tags/latin $(git hash-object -t tag -w --literally latin-tag) + ) && + cgit_ok_url "foo/tag/&h=latin" >tmp && + test_grep "<td>C? Mitter <committer@example.com></td>" tmp && + test_grep "<div class=.commit-subject.>caf? release</div>" tmp && + test_grep ! "$(printf "\\351")" tmp +' + test_expect_success 'a tag page names the tag in its title' ' cgit_ok_url "foo/tag/&h=v1.0" >tmp && grep "<title>v1.0 - foo - Git repository browser</title>" tmp |
