default_delete_branch_after_merge doesn't work #8687

Closed
opened 2025-11-02 08:14:31 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @sprnza on GitHub (Mar 13, 2022).

Gitea Version

1.16.0

Git Version

2.30.2

Operating System

Debian 10

How are you running Gitea?

Gitea is running from docker container

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

I've set default_delete_branch_after_merge to True using this:

http --auth user:pass PATCH https://try.gitea.io/api/v1/repos/user/TestRepo default_delete_branch_after_merge:=true

got this reply:

HTTP/1.1 200 OK

But when I create a PR a get checkbox "Delete branch 'test-branch' unchecked in UI and after merge the branch is not being deleted (so it's not just an UI issue).

Screenshots

No response

Originally created by @sprnza on GitHub (Mar 13, 2022). ### Gitea Version 1.16.0 ### Git Version 2.30.2 ### Operating System Debian 10 ### How are you running Gitea? Gitea is running from docker container ### Database PostgreSQL ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Description I've set `default_delete_branch_after_merge` to True using this: ``` http --auth user:pass PATCH https://try.gitea.io/api/v1/repos/user/TestRepo default_delete_branch_after_merge:=true ``` got this reply: ``` HTTP/1.1 200 OK ``` But when I create a PR a get checkbox "Delete branch 'test-branch' unchecked in UI and after merge the branch is not being deleted (so it's not just an UI issue). ### Screenshots _No response_
GiteaMirror added the type/bugmodifies/api labels 2025-11-02 08:14:32 -06:00
Author
Owner

@noerw commented on GitHub (Mar 22, 2022):

Looking at the code, I think you also need to set "has_pull_requests": true for changes to PR settings to have an effect:

https://github.com/go-gitea/gitea/blob/80c59672335f00283d9edd51b3490787eb28755a/routers/api/v1/repo/repo.go#L842

This doesn't seem like correct behavior to me, though changing this may be a breaking change to some.

@noerw commented on GitHub (Mar 22, 2022): Looking at the code, I think you also need to set `"has_pull_requests": true` for changes to PR settings to have an effect: https://github.com/go-gitea/gitea/blob/80c59672335f00283d9edd51b3490787eb28755a/routers/api/v1/repo/repo.go#L842 This doesn't seem like correct behavior to me, though changing this may be a breaking change to some.
Author
Owner

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

Parent issue #13622

@jolheiser commented on GitHub (Sep 10, 2022): Parent issue #13622
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8687