Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Leave aside the refactoring part of https://github.com/go-gitea/gitea/pull/33433, keep the improvement. Also get a test from https://github.com/go-gitea/gitea/pull/31365 while we're at it. (cherry picked from commit 4ffc54f59a7723eb5aef21955129bdd329ee1d4f)