From f67168cec5755e7d7511a807c7f21907d79328b4 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 4 Nov 2026 21:22:55 -1000 Subject: Keep a repository's own settings in a cached scan A scanned repository is read back from the cached list under the global settings, so a setting that only differed from them by being off, or by naming the default value, came back as the global one. branch-sort was written only for age, per-path module links not at all, and a filter a repository turned off left no line behind. Writing an empty value for a filter turned off makes the list depend on whether each global filter is set, so the scan key names that too. --- tests/t0003-cache.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'tests') diff --git a/tests/t0003-cache.sh b/tests/t0003-cache.sh index 53a6d5b..02622b5 100755 --- a/tests/t0003-cache.sh +++ b/tests/t0003-cache.sh @@ -467,6 +467,53 @@ test_expect_success 'a cached scan leaves the description placeholder out' ' ! grep "kept/one/.git/cgitrc && + { + echo "virtual-root=/" && + echo "cache-root=$PWD/cache6" && + echo "cache-size=64" && + echo "trust-scan-config=1" && + echo "branch-sort=age" && + echo "scan-path=$PWD/kept" + } >unfilteredrc && + { + echo "about-filter=exec:$FILTER_DIRECTORY/dump.sh" && + cat unfilteredrc + } >keptrc && + rm -rf cache6 && mkdir cache6 && + cgit_rc unfilteredrc "url=" >/dev/null && + cgit_rc keptrc "url=" >/dev/null && + cgit_rc keptrc "url=one/refs/" >tmp && + sed -n "s/^]*>\([a-z]*\)<.*/\1/p" tmp >branches && + test_write_lines aaa master zzz >expect && + test_cmp expect branches && + cgit_rc keptrc "url=one/about/" >tmp && + grep "
1$" tmp &&
+	cgit_rc keptrc "url=one/tree/" >tmp &&
+	grep "href=.https://example.org/s/?id=$sub." 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' '
-- 
cgit 2.12.1