diff options
Diffstat (limited to 'tests/t0303-robustness.sh')
-rwxr-xr-xtests/t0303-robustness.sh10
1 file changed, 10 insertions, 0 deletions
diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh
index 7b037bf..888ca7f 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 "<pre class=.plaintext.>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.