From 68315365e6f7add9a7cff21c6d01ad71a47e3ced Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 18:45:56 -1000 Subject: Test a word in a scanned repository's cgitrc --- tests/t0205-config.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/t0205-config.sh b/tests/t0205-config.sh index 88a271f..8999497 100755 --- a/tests/t0205-config.sh +++ b/tests/t0205-config.sh @@ -223,6 +223,20 @@ test_expect_success 'a word in a scanned git config is reported' ' test_grep -F "Reading hide=true in $PWD/wordscan/foo.git/config line $line as 0, since it is not a whole number" err ' +test_expect_success 'a word in a scanned cgitrc is reported' ' + git clone -q --bare repos/foo/.git wordrcscan/foo.git && + printf "%s\n" "# set by the owner" "desc=scanned" "hide=yes" >wordrcscan/foo.git/cgitrc && + { + echo "virtual-root=/" && + echo "cache-size=0" && + echo "scan-path=$PWD/wordrcscan" + } >wordrcscanrc && + cgit_rc wordrcscanrc "url=" >tmp 2>err && + grep ">foo.git" tmp && + test_grep -F "Reading hide=yes in $PWD/wordrcscan/foo.git/cgitrc line 3 as 0, since it is not a whole number" err && + test_line_count = 1 err +' + # A snapshot format name that matches nothing used to drop out without a # word, so a typo read like a format left off on purpose. The legacy 0 for # none stays quiet, and a leading number other than 0 still means tar alone. -- cgit 2.12.1