Editing Repositories via API ignores default_merge_style #8564

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

Originally created by @ghost on GitHub (Feb 15, 2022).

Gitea Version

1.16.1

Git Version

No response

Operating System

No response

How are you running Gitea?

Using the Linux x64 binaries from the releases page.

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

When editing repos via the API, the value of default_merge_style is ignored.

Querying the API with curl/jq before the change:

$ export GITEA_ACCESS_TOKEN=[...]
$ curl -s -H "Authorization: token $GITEA_ACCESS_TOKEN" https://try.gitea.io/api/v1/repos/7CLfteiIYWtD/test | jq .default_merge_style
"merge"

Trying to change the setting via the API:

$ curl -s -H "Authorization: token $GITEA_ACCESS_TOKEN" -X PATCH -H 'Content-Type: application/json' -d '{"default_merge_style": "rebase"}' https://try.gitea.io/api/v1/repos/7CLfteiIYWtD/test | jq .default_merge_style
"merge"

This should have returned "rebase".

After changing the default merge style through the UI:

$ curl -s -H "Authorization: token $GITEA_ACCESS_TOKEN" https://try.gitea.io/api/v1/repos/7CLfteiIYWtD/test | jq .default_merge_style
"rebase"

Screenshots

No response

Originally created by @ghost on GitHub (Feb 15, 2022). ### Gitea Version 1.16.1 ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Using the Linux x64 binaries from the releases page. ### Database _No response_ ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Description When editing repos via the API, the value of `default_merge_style` is ignored. Querying the API with curl/jq before the change: ``` $ export GITEA_ACCESS_TOKEN=[...] $ curl -s -H "Authorization: token $GITEA_ACCESS_TOKEN" https://try.gitea.io/api/v1/repos/7CLfteiIYWtD/test | jq .default_merge_style "merge" ``` Trying to change the setting via the API: ``` $ curl -s -H "Authorization: token $GITEA_ACCESS_TOKEN" -X PATCH -H 'Content-Type: application/json' -d '{"default_merge_style": "rebase"}' https://try.gitea.io/api/v1/repos/7CLfteiIYWtD/test | jq .default_merge_style "merge" ``` This **should** have returned `"rebase"`. After changing the default merge style through the UI: ``` $ curl -s -H "Authorization: token $GITEA_ACCESS_TOKEN" https://try.gitea.io/api/v1/repos/7CLfteiIYWtD/test | jq .default_merge_style "rebase" ``` ### Screenshots _No response_
GiteaMirror added the type/bugmodifies/api labels 2025-11-02 08:10:55 -06:00
Author
Owner

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

I'm pretty sure has the same cause as described in https://github.com/go-gitea/gitea/issues/19069#issuecomment-1075517026

@noerw commented on GitHub (Mar 22, 2022): I'm pretty sure has the same cause as described in https://github.com/go-gitea/gitea/issues/19069#issuecomment-1075517026
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#8564