Skip to content

500 server error when trying to update a PR that contains conflicts with rebase #16922

Closed
@qwerty287

Description

@qwerty287
  • Gitea version (or commit ref):1.16.0+dev-192-g268b2d0c9
  • Git version:2.30.2
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes
    • No
  • Logs:
.../api/v1/repo/pull.go:1140:UpdatePullRequest() [E] pull_service.Update: Rebase Error: exit status 1: Whilst Rebasing: <commit hash>
        Rebasing (1/1)\01503derror: could not apply <commit hash>... change README.md
        Resolve all conflicts manually, mark them as resolved with
        "git add/rm <conflicted_files>", then run "git rebase --continue".
        You can instead skip this commit: run "git rebase --skip".
        To abort and get back to the state before "git rebase", run "git rebase --abort".
        Could not apply 5a5fa47... change README.md

        Auto-merging README.md
        CONFLICT (content): Merge conflict in README.md
Completed POST /api/v1/repos/qwerty287/tests/pulls/1/update?style=rebase 500 Internal Server Error in 258.618144ms

Description

If I try to update a PR with conflicts via rebase (using the API), I get a 500 error. If I use the default merge option, I get a 409 Conflict error, which is better. It would be nice if it could return a 409 error if the PR contains conflicts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions