diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
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.
Diffstat (limited to 'tests/t0303-robustness.sh')
-rwxr-xr-xtests/t0303-robustness.sh14
1 file changed, 14 insertions, 0 deletions
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 &&