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

Can not set default_delete_branch_after_merge using API #21077

Closed
jsalatiel opened this issue Sep 5, 2022 · 4 comments · Fixed by #21130
Closed

Can not set default_delete_branch_after_merge using API #21077

jsalatiel opened this issue Sep 5, 2022 · 4 comments · Fixed by #21130
Labels

Comments

@jsalatiel
Copy link

jsalatiel commented Sep 5, 2022

Description

It is not possible to set default_delete_branch_after_merge using API.

E.g.

curl  --header "Content-Type: application/json-patch+json" -H 'Authorization: token TOKEN_HERE'  -X PATCH -d '{"default_delete_branch_after_merge": true}' https://try.gitea.io/api/v1/repos/salas/teste

Gitea Version

1.16.5

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker

Database

PostgreSQL

@jolheiser
Copy link
Member

This has the same root cause as #13622

I'm going to close this issue as the parent issue would subsequently fix this, and by mentioning it I've linked them together. 🙂

@jsalatiel
Copy link
Author

jsalatiel commented Sep 10, 2022

@jolheiser not sure if this is related. I do not even see this parameter returned by the api. Btw, the supposed parent is opened for two years. If there a solution for it?

@delvh
Copy link
Member

delvh commented Sep 10, 2022

#21130, if I understand that correctly.

@jsalatiel
Copy link
Author

Found it. The json must also contain has_pull_requests: true
e.g.

'{"has_pull_requests": true, "default_delete_branch_after_merge": true}'

6543 added a commit that referenced this issue Sep 27, 2022
This PR would presumably
Fix #20522
Fix #18773
Fix #19069
Fix #21077

Fix #13622

-----

1. Check whether unit type is currently enabled
2. Check if it _will_ be enabled via opt
3. Allow modification as necessary


Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants