From b13a99f24c51c2ecc3e49b3061ea7eed182d9c1a Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 06:09:01 -1000 Subject: Keep a repository with an empty url ignored The field resets at the end of cgit_add_repo cleared the ignore flag that the empty url branch had just set, so such a repository was listed on the index and selectable with ?r=, where every link to it read the byte before its url. --- tests/t0303-robustness.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index 8dff969..e1b7b3a 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -43,12 +43,17 @@ test_expect_success 'a repository with an empty url is skipped with a warning' ' echo "cache-size=0" && echo "repo.url=" && echo "repo.path=$PWD/repos/rob/.git" && + echo "repo.desc=nourl" && echo "repo.url=rob" && echo "repo.path=$PWD/repos/rob/.git" } >nourlrc && CGIT_CONFIG="$PWD/nourlrc" QUERY_STRING="url=rob/" cgit >tmp 2>err && grep "^Status: 200" tmp && - grep "Ignoring repository with an empty url" err + grep "Ignoring repository with an empty url" err && + CGIT_CONFIG="$PWD/nourlrc" QUERY_STRING="url=" cgit >tmp && + ! grep nourl tmp && + CGIT_CONFIG="$PWD/nourlrc" QUERY_STRING="r=" cgit >tmp && + ! grep nourl tmp ' test_expect_success 'a scan path that is itself a repository is named after it' ' -- cgit