Can not set default_delete_branch_after_merge using API #9519

Closed
opened 2025-11-02 08:41:29 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @jsalatiel on GitHub (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

Originally created by @jsalatiel on GitHub (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
GiteaMirror added the type/bug label 2025-11-02 08:41:29 -06:00
Author
Owner

@jolheiser commented on GitHub (Sep 10, 2022):

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. 🙂

@jolheiser commented on GitHub (Sep 10, 2022): 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. :slightly_smiling_face:
Author
Owner

@jsalatiel commented on GitHub (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?

@jsalatiel commented on GitHub (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?
Author
Owner

@delvh commented on GitHub (Sep 10, 2022):

https://github.com/go-gitea/gitea/pull/21130, if I understand that correctly.

@delvh commented on GitHub (Sep 10, 2022): https://github.com/go-gitea/gitea/pull/21130, if I understand that correctly.
Author
Owner

@jsalatiel commented on GitHub (Sep 11, 2022):

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

'{"has_pull_requests": true, "default_delete_branch_after_merge": true}'
@jsalatiel commented on GitHub (Sep 11, 2022): Found it. The json must also contain has_pull_requests: true e.g. ``` '{"has_pull_requests": true, "default_delete_branch_after_merge": true}' ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9519