From d368a3c577220e6ce69f417f300ba1a1a1ed9714 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 09:55:09 -1000 Subject: Match logged paths as fixed strings The messages hold the trash directory's path and were matched as patterns, so a checkout path holding a bracket or a star would break them. --- tests/t0205-config.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/t0205-config.sh b/tests/t0205-config.sh index 79a5db0..6d4a0ff 100755 --- a/tests/t0205-config.sh +++ b/tests/t0205-config.sh @@ -44,7 +44,7 @@ test_expect_success 'a filter in a scanned repository is reported without its fl } >scanrc && cgit_rc scanrc "url=foo.git/commit/" >tmp 2>err && grep "
commit 5" tmp && - grep "Ignoring commit-filter in $PWD/scan/foo.git/: trust-scan-config is not set" err + test_grep -F "Ignoring commit-filter in $PWD/scan/foo.git/: trust-scan-config is not set" err ' test_expect_success 'the flag lets a scanned repository set its filters' ' @@ -126,17 +126,17 @@ test_expect_success 'line endings, comments and stray lines leave the rest alone test_expect_success 'a config file that cannot be read is reported' ' CGIT_CONFIG="$PWD/no-such-rc" QUERY_STRING="url=" cgit >tmp 2>err && grep "No repositories found" tmp && - grep "Unable to read config file $PWD/no-such-rc: No such file or directory" err && + test_grep -F "Unable to read config file $PWD/no-such-rc: No such file or directory" err && mkdir rc-dir && CGIT_CONFIG="$PWD/rc-dir" QUERY_STRING="url=" cgit >tmp 2>err && - grep "Unable to read config file $PWD/rc-dir: Is a directory" err && + test_grep -F "Unable to read config file $PWD/rc-dir: Is a directory" err && { echo "include=$PWD/no-such-include" && cat diagrc } >includerc && cgit_rc includerc "url=diag/" >tmp 2>err && grep "Status: 200" tmp && - grep "Unable to read config file $PWD/no-such-include: No such file or directory" err + test_grep -F "Unable to read config file $PWD/no-such-include: No such file or directory" err ' # An include is parsed from inside the line that names it, so a file that @@ -196,15 +196,15 @@ test_expect_success 'a word where a number belongs is reported' ' cgit_rc wordrc "url=" >tmp 2>err && grep ">word" tmp && ! grep "col-owner" tmp && - grep "Reading enable-index-owner=no in $PWD/wordrc line 3 as 0, since it is not a whole number" err && - grep "Reading hide=yes in $PWD/wordrc line 7 as 0, since it is not a whole number" err && + test_grep -F "Reading enable-index-owner=no in $PWD/wordrc line 3 as 0, since it is not a whole number" err && + test_grep -F "Reading hide=yes in $PWD/wordrc line 7 as 0, since it is not a whole number" err && ! grep "max-repo-count" err && { echo "include=$PWD/wordrc" && echo "enable-blame=on" } >outerrc && cgit_rc outerrc "url=" >tmp 2>err && - grep "Reading enable-blame=on in $PWD/outerrc line 2 as 0, since it is not a whole number" err + test_grep -F "Reading enable-blame=on in $PWD/outerrc line 2 as 0, since it is not a whole number" err ' test_expect_success 'a word in a scanned git config is reported' ' @@ -219,7 +219,7 @@ test_expect_success 'a word in a scanned git config is reported' ' } >wordscanrc && cgit_rc wordscanrc "url=" >tmp 2>err && grep ">foo.git" tmp && - grep "Reading hide=true in $PWD/wordscan/foo.git/config line $line as 0, since it is not a whole number" err + test_grep -F "Reading hide=true in $PWD/wordscan/foo.git/config line $line as 0, since it is not a whole number" err ' # A snapshot format name that matches nothing used to drop out without a @@ -231,8 +231,8 @@ test_expect_success 'an unknown snapshot format is reported' ' cgit_rc snaprc "url=snap/commit/" >tmp 2>err && grep "href=./snap/snapshot/snap-master.tar.>" tmp && ! grep "snap-master.tar.gz" tmp && - grep "Ignoring unknown snapshot format zap in $PWD/snaprc line 3" err && - grep "Ignoring unknown snapshot format tar.gzz in $PWD/snaprc line 6" err && + test_grep -F "Ignoring unknown snapshot format zap in $PWD/snaprc line 3" err && + test_grep -F "Ignoring unknown snapshot format tar.gzz in $PWD/snaprc line 6" err && test_line_count = 2 err && cgitrc_repo legacyrc snap "snapshots=2 zip" "repo.path=$PWD/repos/foo/.git" && cgit_rc legacyrc "url=snap/commit/" >tmp 2>err && @@ -246,13 +246,13 @@ test_expect_success 'an unknown snapshot format is reported' ' test_expect_success 'a repository that will not open is logged with its path' ' cgit_rc gonerc "url=gone/log/" >tmp 2>err && grep "^Status: 404 Not Found" tmp && - grep "Unable to open repository gone at $PWD/no/such/repo/.git: No such file or directory" err && + test_grep -F "Unable to open repository gone at $PWD/no/such/repo/.git: No such file or directory" err && test_line_count = 1 err && mkdir not-a-repo && cgitrc_repo notreporc notrepo "repo.path=$PWD/not-a-repo" && cgit_rc notreporc "url=notrepo/" >tmp 2>err && grep "^Status: 404 Not Found" tmp && - grep "Unable to open repository notrepo at $PWD/not-a-repo: " err + test_grep -F "Unable to open repository notrepo at $PWD/not-a-repo: " err ' test_done -- cgit 2.12.1