Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 2 tasks
jpraet opened this issue Apr 23, 2021 · 0 comments · Fixed by #15778
Closed
1 of 2 tasks

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

jpraet opened this issue Apr 23, 2021 · 0 comments · Fixed by #15778
Assignees
Labels
issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself modifies/api This PR adds API routes or modifies them
Milestone

Comments

@jpraet
Copy link
Member

jpraet commented Apr 23, 2021

  • 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

@lunny lunny added the issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself label Apr 24, 2021
@lunny lunny added this to the 1.14.2 milestone Apr 24, 2021
@6543 6543 added the modifies/api This PR adds API routes or modifies them label May 7, 2021
@6543 6543 self-assigned this May 7, 2021
6543 added a commit to 6543-forks/gitea that referenced this issue May 7, 2021
6543 added a commit that referenced this issue May 8, 2021
6543 added a commit to 6543-forks/gitea that referenced this issue May 8, 2021
6543 added a commit that referenced this issue May 8, 2021
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself modifies/api This PR adds API routes or modifies them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants