Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Move the tree grouping test to the tree tests
Grouping folders first is tree page behaviour rather than a security
fix, so it joins the tree tests on a repository of its own.
Diffstat (limited to 'tests/t0104-tree.sh')
| -rwxr-xr-x | tests/t0104-tree.sh | 18 |
1 file changed, 18 insertions, 0 deletions
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index f17dd34..a42b247 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -453,4 +453,22 @@ test_expect_success 'a NUL past the first 8000 bytes still gets a blame link' ' test_grep ! ">blame</a>" tmp ' + +# Grouping directories ahead of files is behaviour this fork adds, so nothing +# upstream covers it. The directory sorts after the file by name, so only the +# grouping can put it first. +test_expect_success 'tree groups directories before files' ' + test_create_repo repos/grouped && + mkdir repos/grouped/zsub && + test_commit -C repos/grouped --no-tag inner zsub/inner && + test_commit -C repos/grouped --no-tag top afile && + cgitrc_repo groupedrc grouped enable-tree-group-dirs=1 && + cgit_ok groupedrc "url=grouped/tree/" >tmp && + dirline=$(grep -n "tree/zsub" tmp | head -n 1 | cut -d: -f1) && + fileline=$(grep -n "tree/afile" tmp | head -n 1 | cut -d: -f1) && + test -n "$dirline" && + test -n "$fileline" && + test "$dirline" -lt "$fileline" +' + test_done |
