Description
Updating a repository's default_delete_branch_after_merge property via the PATCH API endpoint does not persist the change, even though the API returns a 200 OK status.
Reproduction Steps:
- Identify a repository (e.g., hnrx/test).
- Send a PATCH request to /api/v1/repos/hnrx/test with the following payload:
{ "default_delete_branch_after_merge": true }
- The response is HTTP 200 OK and includes the full repository JSON object.
- Observe that in the response JSON, "default_delete_branch_after_merge" is still false.
- Check the Web UI settings for the repository; the option remains disabled.
Additional Context:
- Other properties (like name or description) can be successfully updated using the same PATCH call.
- The issue persists regardless of whether ALLOW_KEEP_PULL_REQUEST_HEAD_BRANCH is explicitly set in the app.ini or not.
- Testing via the built-in Swagger UI produces the same incorrect behavior.
- Manual update via Web UI works: Setting the "Delete branch after merge" option manually in the repository settings via the web interface works perfectly and persists as expected. The issue is strictly limited to the API PATCH method.
Expected behavior: The property should be updated to true in the database and reflected in the API response and Web UI.
Gitea Version
1.25.4
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
official docker container
Database
SQLite
Description
Updating a repository's
default_delete_branch_after_mergeproperty via the PATCH API endpoint does not persist the change, even though the API returns a 200 OK status.Reproduction Steps:
{ "default_delete_branch_after_merge": true }
Additional Context:
Expected behavior: The property should be updated to true in the database and reflected in the API response and Web UI.
Gitea Version
1.25.4
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
official docker container
Database
SQLite