From a3bb7c69c0295cb2fc7909559456e798b222fccd Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 14:56:59 -0700 Subject: Add the shared config writers and cgit_rc The helpers are named by kind. cgitrc_repo and cgitrc_copy write the config file named first, and cgit_url, cgit_query and cgit_rc run cgit, each named after what it is handed first. A repository copies its defaults from the globals read before its repo.url, so cgitrc_repo places every setting itself, and a global can no longer land where it silently stops applying. The t00xx and t01xx files move to them here. --- tests/t0101-index.sh | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'tests/t0101-index.sh') diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index e50f0f8..c8b9fb7 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -22,23 +22,15 @@ test_expect_success 'no tree-link' '! grep "foo/tree" tmp' test_expect_success 'no log-link' '! grep "foo/log" tmp' test_expect_success 'index links lead to the summary, log and tree' ' - echo "enable-index-links=1" >links-cgitrc && - sed "s/^cache-size=.*/cache-size=0/" cgitrc >>links-cgitrc && - CGIT_CONFIG="$PWD/links-cgitrc" QUERY_STRING="url=" cgit >tmp && + cgitrc_copy links-cgitrc enable-index-links=1 && + cgit_rc links-cgitrc "url=" >tmp && grep ">summarylog" tmp && grep "href=./foo/log/.>logtree<" tmp ' test_expect_success 'each css and js entry gets a link of its own' ' - { - echo "css=/a.css" && - echo "css=/b.css" && - echo "js=/a.js" && - echo "js=" && - echo "js=/b.js" - } >headrc && - sed "s/^cache-size=.*/cache-size=0/" cgitrc >>headrc && - CGIT_CONFIG="$PWD/headrc" QUERY_STRING="url=" cgit >tmp && + cgitrc_copy headrc css=/a.css css=/b.css js=/a.js js= js=/b.js && + cgit_rc headrc "url=" >tmp && grep "" tmp && grep "" tmp && grep "