From f3e8aea5b8bc91e70ebc49f88ba59f957c5a9a6e Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 4 Nov 2026 20:59:41 -1000 Subject: Keep the placeholder out of a cached scan The cached list wrote "[no description]" like any other description, so once read back it no longer counted as the placeholder and became the meta description of every repository without one. Repositories read back from the list are also marked as having had their description file read, since the scan already did, so the index does not open those files again on every request. --- tests/t0003-cache.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/t0003-cache.sh') diff --git a/tests/t0003-cache.sh b/tests/t0003-cache.sh index 0504c88..53a6d5b 100755 --- a/tests/t0003-cache.sh +++ b/tests/t0003-cache.sh @@ -455,6 +455,18 @@ test_expect_success 'a negative cache-scan-ttl never expires the list' ' ! grep "^repo.url=kept$" "cache5/$scanned_rc" ' +# A repository the scan found without a description goes into the list +# without one, so its pages do not describe themselves with the placeholder. +test_expect_success 'a cached scan leaves the description placeholder out' ' + rm -rf cache5 && mkdir cache5 && + cgit_rc scanrc "url=" >/dev/null && + ! grep "^repo.desc=" cache5/rc-* && + cgit_rc scanrc "url=" >tmp && + grep "\[no description\]" tmp && + cgit_rc scanrc "url=one/" >tmp && + ! grep "