Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
Diffstat (limited to 'tests/t0003-cache.sh')
| -rwxr-xr-x | tests/t0003-cache.sh | 12 |
1 file changed, 12 insertions, 0 deletions
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 "<meta name=.description." tmp +' + # 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' ' |
