Skip to content

Editing Repositories via API ignores default_merge_style #18773

Closed
@ghost

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    modifies/apiThis PR adds API routes or modifies themtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions