From 9b2c4a47c50c07528eae643b867d434d4629d08e Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 18:51:17 -1000 Subject: Show the missing repository's config does cache An empty cache passed just as well when nothing was cached at all. --- tests/t0205-config.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/t0205-config.sh b/tests/t0205-config.sh index 81ab66f..5975303 100755 --- a/tests/t0205-config.sh +++ b/tests/t0205-config.sh @@ -66,13 +66,17 @@ test_expect_success 'a repo filter in the main cgitrc needs no flag' ' ! grep "about-filter" err ' +# The repository may turn up before a cached 404 would expire, so error pages +# skip the cache. A page from one that opens shows this config does cache. test_expect_success 'a repository whose path is missing answers 404' ' { echo "virtual-root=/" && echo "cache-size=1021" && echo "cache-root=$PWD/gone-cache" && echo "repo.url=gone" && - echo "repo.path=$PWD/no/such/repo/.git" + echo "repo.path=$PWD/no/such/repo/.git" && + echo "repo.url=foo" && + echo "repo.path=$PWD/repos/foo/.git" } >gonerc && mkdir -p gone-cache && for page in "" log/ commit/ "tag/&h=x" atom/ plain/f @@ -81,7 +85,10 @@ test_expect_success 'a repository whose path is missing answers 404' ' grep "^Status: 404 Not Found" tmp && grep "Failed to open gone: No such file or directory" tmp || return 1 done && - test -z "$(ls gone-cache)" + test -z "$(ls gone-cache)" && + cgit_ok gonerc "url=foo/log/" >tmp && + ls gone-cache >slots && + test_line_count = 1 slots ' test_expect_success 'a fully understood config stays silent' ' -- cgit 2.12.1