From a3a9f7288306802a80693fa0aa8213b65d932479 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 4 Nov 2026 20:33:08 -1000 Subject: Leave the scan uncached with a negative cache-size The page cache counts a cache-size of 0 or less as off, but scan-path cached its list for any value other than 0, so a negative one still wrote a list into cache-root. --- tests/t0003-cache.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/t0003-cache.sh') diff --git a/tests/t0003-cache.sh b/tests/t0003-cache.sh index fa72015..0504c88 100755 --- a/tests/t0003-cache.sh +++ b/tests/t0003-cache.sh @@ -455,4 +455,19 @@ test_expect_success 'a negative cache-scan-ttl never expires the list' ' ! grep "^repo.url=kept$" "cache5/$scanned_rc" ' +# A cache-size below zero turns the page cache off, and the scan with it, so +# the cache directory stays empty. +test_expect_success 'a negative cache-size leaves the scan uncached' ' + { + echo "virtual-root=/" && + echo "cache-root=$PWD/cache-negative" && + echo "cache-size=-1" && + echo "scan-path=$PWD/scanned" + } >negativerc && + rm -rf cache-negative && mkdir cache-negative && + cgit_rc negativerc "url=" >tmp && + grep ">one" tmp && + test_dir_is_empty cache-negative +' + test_done -- cgit 2.12.1