Skip to content

[Bug] [API] repoCreateFile return 500 if branch not exist #10982

Closed
@6543

Description

@6543

as title

try: curl -X POST "https://try.gitea.io/api/v1/repos/abcKing/repo_uninit/contents/README.md?token=yourtocken" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"author\": { \"email\": \"[email protected]\", \"name\": \"string\" }, \"branch\": \"string\", \"committer\": { \"email\": \"[email protected]\", \"name\": \"string\" }, \"content\": \"c3RyaW5nCg==\", \"dates\": { \"author\": \"2020-04-06T01:37:35.137Z\", \"committer\": \"2020-04-06T01:37:35.137Z\" }, \"message\": \"string\"}"

It return:

{
  "message": "branch does not exist [name: string]",
  "url": "https://try.gitea.io/api/swagger"
}

Gitea Version: 1.12.0+dev-89-gb264c3039

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions