From d44de99c7504ec3610c7ed502fd0d4208f2545cc Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 17:28:58 -1000 Subject: Add a helper for configs of several repositories The configs a run of t0101 writes are byte for byte what they were. The scan configs name no repository and descrc adds one to a copy of the shared config, so those keep their own form. --- tests/setup.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/setup.sh') diff --git a/tests/setup.sh b/tests/setup.sh index 26a3f67..ac6e293 100644 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -293,6 +293,16 @@ cgitrc_repo() { "repo.url=$cgitrc_url$LF" "$cgitrc_path$LF" "$cgitrc_after" >"$cgitrc_file" } +# Writes a config to the file named first with the cache off and links rooted +# at /, as cgitrc_repo does, followed by the rest as lines of their own. They +# keep the order given, since a repo.* setting goes to the repository named +# last and a section takes in the repositories after it. +cgitrc_repos() { + cgitrc_file=$1 + shift + printf '%s\n' virtual-root=/ cache-size=0 "$@" >"$cgitrc_file" +} + # Writes the global settings named after the file ahead of a copy of the # shared cgitrc. The copy turns the cache off, because a page is cached under # its request alone and would otherwise come back as the shared config made -- cgit 2.12.1