From fa0dda155249f8bf409ec031c26baabf6833e3f8 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 3 Oct 2026 09:46:30 -1000 Subject: Leave readme out of what scan-path fixes --- MANUAL.txt | 8 +++++--- tests/t0303-robustness.sh | 10 ++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 1c24e1a..d9a8188 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -465,9 +465,11 @@ scan-path:: repository containing a file named "noweb" is skipped, the reverse of what "strict-export" checks. Only the global settings taken before the scan-path directive apply to each repository. That holds for every - setting a repository inherits, among them section, snapshots, readme, - the filters and the enable flags, not only the entries that say so - explicitly. Default value: none. See also: cache-scan-ttl, project-list, + setting a repository inherits, among them section, snapshots, the + filters and the enable flags, not only the entries that say so + explicitly. The readme list is the exception, since a repository with + none of its own follows the global list as the whole cgitrc leaves it. + Default value: none. See also: cache-scan-ttl, project-list, strict-export, "Macro expansion". section:: diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index d889a32..6e8f0c0 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -127,6 +127,16 @@ test_expect_success 'a readme ending in a colon is refused like a path on disk' ! grep "outside the repository" tmp ' +# The readme list is read as a page is served rather than copied at the +# scan-path line, so a readme set after the scan still applies. +test_expect_success 'a readme set after scan-path reaches a scanned repository' ' + rm scan/b.git/cgitrc && + cat gitcfgrc >laterrc && + echo "readme=master:file-1" >>laterrc && + CGIT_CONFIG="$PWD/laterrc" QUERY_STRING="url=b.git/about/" cgit >tmp && + grep "
1$" tmp
+'
+
 # A repository served as html runs its pages on the site's own origin, so
 # the switch waits on trust like the keys that place markup. The warning has
 # to name the repository, which it did not for a key read from git config.
-- 
cgit 2.12.1