Closed
Description
- Gitea version (or commit ref): Powered by Gitea Version: 1.11.3
- Git version: 2.17.1
- Operating system: Ubuntu
- Database (use
[x]
):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- [ x] Yes (provide example URL) https://try.gitea.io/mattiasbpersson/test/settings/branches/master
- No
- Not relevant
- Log gist:
Description
When enabling "Branch Protection for Branch" you are no longer able to request the api for:
https://try.gitea.io/api/v1/repos/mattiasbpersson/test/branches
Example code run in script console in Jenkins:
import groovy.json.JsonSlurper
def REPO = "led-deploy"
def DEFAULT_BRANCH = "master"
List<String> branches = [DEFAULT_BRANCH]
URL url = new URL("https://try.gitea.io/api/v1/repos/mattiasbpersson/test/branches")
final slurper = new JsonSlurper()
def json = slurper.parse(url)
json.each { item ->
branches << item.name
}
If branch protection is disabled master branch is returned. If it is enabled you get:
java.io.IOException: Server returned HTTP response code: 500 for URL: https://try.gitea.io/api/v1/repos/mattiasbpersson/test/branches
...