Diff options
Diffstat (limited to '')
-rwxr-xr-xtests/t0301-security.sh31
1 file changed, 8 insertions, 23 deletions
diff --git a/tests/t0301-security.sh b/tests/t0301-security.sh
index 73af518..01dd793 100755
--- a/tests/t0301-security.sh
+++ b/tests/t0301-security.sh
@@ -204,32 +204,17 @@ test_expect_success 'set up a repo whose branches point at odd objects' '
} >oddrefrc
'
-test_expect_success 'refs page sorts such branches without crashing' '
- CGIT_CONFIG="$PWD/oddrefrc" QUERY_STRING="url=oddref/refs/" cgit >tmp &&
- grep "points-at-tree" tmp &&
- grep "</html>" tmp
-'
-
-test_expect_success 'the branch page sorts them without crashing' '
- CGIT_CONFIG="$PWD/oddrefrc" QUERY_STRING="url=oddref/refs/heads/" cgit >tmp &&
- grep "points-at-tree" tmp &&
- grep "</html>" tmp
-'
-
-test_expect_success 'the summary page sorts them without crashing' '
- CGIT_CONFIG="$PWD/oddrefrc" QUERY_STRING="url=oddref/" cgit >tmp &&
- grep "points-at-tree" tmp &&
- grep "</html>" tmp
+test_expect_success 'the refs, branch and summary pages sort such branches' '
+ for page in refs/ refs/heads/ ""
+ do
+ CGIT_CONFIG="$PWD/oddrefrc" QUERY_STRING="url=oddref/$page" cgit >tmp &&
+ grep "points-at-tree" tmp &&
+ grep "</html>" tmp || return 1
+ done
'
test_expect_success 'name-sorted branches are unaffected' '
- {
- echo "virtual-root=/" &&
- echo "cache-size=0" &&
- echo "branch-sort=name" &&
- echo "repo.url=oddref" &&
- echo "repo.path=$PWD/repos/oddref/.git"
- } >oddrefnamerc &&
+ sed "s/^branch-sort=age$/branch-sort=name/" oddrefrc >oddrefnamerc &&
CGIT_CONFIG="$PWD/oddrefnamerc" QUERY_STRING="url=oddref/refs/heads/" cgit >tmp &&
grep "points-at-tree" tmp &&
grep "</html>" tmp