From d94813094e8ea7de1a3e34f16bcca31a66c895ba Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 12:29:58 -1000 Subject: Test a plain listing below the root --- tests/t0105-plain.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/t0105-plain.sh b/tests/t0105-plain.sh index 97c1164..0ed974e 100755 --- a/tests/t0105-plain.sh +++ b/tests/t0105-plain.sh @@ -34,6 +34,29 @@ test_expect_success 'a directory answers with a listing of links' ' test_grep "
  • file-5
  • " tmp ' +# A folder's listing leads back up a level, to the root's listing from a +# folder at the top. +test_expect_success 'a folder listing links its entries and its parent' ' + test_create_repo repos/folders && + ( + cd repos/folders && + mkdir -p dir/sub && + echo a >dir/a.txt && + echo b >dir/sub/b.txt && + git add dir && + git commit -m folders + ) && + cgitrc_repo foldersrc folders && + cgit_ok foldersrc "url=folders/plain/dir" >tmp && + test_grep "/dir/" tmp && + test_grep "
  • \.\./
  • " tmp && + test_grep "
  • a.txt
  • " tmp && + test_grep "
  • sub
  • " tmp && + cgit_ok foldersrc "url=folders/plain/dir/sub" >tmp && + test_grep "
  • \.\./
  • " tmp && + test_grep "
  • b.txt
  • " tmp +' + test_expect_success 'a blob whose bytes look binary is served as octet-stream' ' ( cd repos/foo && -- cgit 2.12.1