Skip to content

API: PATCH api/v1/repos/{username}/{reponame} does not work when repo is empty #15602

Closed
@jpraet

Description

@jpraet
  • Gitea version (or commit ref): 1.14.1
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No

Description

curl -X 'PATCH' \
  'http://localhost:3000/api/v1/repos/jpraet/test?token=*' \
  -H 'accept: application/json' \
  -H 'authorization: Basic anByYWV0OmZlY2t5b3Uy' \
  -H 'Content-Type: application/json' \
  -d '{
  "has_pull_requests": true,
  "allow_rebase": false
}'

This returns an empty HTTP 200 response, but the changes were not applied.
This is for an empty repository. It works correctly on a non-empty repo.
This is a regression in 1.14, it works on 1.13.

I think the issue may be here:

https://github.com/go-gitea/gitea/blob/master/modules/context/api.go#L281-L284

Metadata

Metadata

Assignees

Labels

issue/regressionIndicates a previously functioning feature or behavior that has broken or regressed after a changemodifies/apiThis PR adds API routes or modifies them

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions