Gitea not detecting merge conflict properly and failing to merge #12445

Closed
opened 2025-11-02 10:10:01 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @TheBrokenRail on GitHub (Feb 7, 2024).

Description

I'm trying to merge a PR (with the method "Rebase then fast-forward"). But when I click the merge button, it just pops up a message saying "Network error." When I checked the logs it revealed it was an issue with merge conflicts.

The Gitea UI does say that the branch is out-of-date, but it says it should be OK to merge. The "Update branch by merge/rebase" button doesn't do anything and doesn't even appear on https://try.gitea.io.

The PR on https://try.gitea.io: https://try.gitea.io/TheBrokenRail/minecraft-pi-reborn/pulls/1

Gitea Version

v1.21.5

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/TheBrokenRail/e6c0004d81c89d2d4af69688a4e01165

Screenshots

image

Git Version

2.40.1

Operating System

Ubuntu 22.04

How are you running Gitea?

Inside the official Docker container.

Database

SQLite

Originally created by @TheBrokenRail on GitHub (Feb 7, 2024). ### Description I'm trying to merge a PR (with the method "Rebase then fast-forward"). But when I click the merge button, it just pops up a message saying "Network error." When I checked the logs it revealed it was an issue with merge conflicts. The Gitea UI does say that the branch is out-of-date, but it says it should be OK to merge. The "Update branch by merge/rebase" button doesn't do anything and doesn't even appear on https://try.gitea.io. The PR on https://try.gitea.io: https://try.gitea.io/TheBrokenRail/minecraft-pi-reborn/pulls/1 ### Gitea Version v1.21.5 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist https://gist.github.com/TheBrokenRail/e6c0004d81c89d2d4af69688a4e01165 ### Screenshots ![image](https://github.com/go-gitea/gitea/assets/17478432/f76d2192-0b68-4cab-946d-41872ad7a508) ### Git Version 2.40.1 ### Operating System Ubuntu 22.04 ### How are you running Gitea? Inside the official Docker container. ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 10:10:01 -06:00
Author
Owner

@yp05327 commented on GitHub (Feb 7, 2024):

Missing Redirect -> JSONRedirect changes in #28140
image

As we are using more and more form-fetch-action, maybe we need to add some tests for these responses.

@yp05327 commented on GitHub (Feb 7, 2024): Missing `Redirect` -> `JSONRedirect` changes in #28140 ![image](https://github.com/go-gitea/gitea/assets/18380374/0ca0736b-eab9-493d-b45f-521584837eb5) As we are using more and more `form-fetch-action`, maybe we need to add some tests for these responses.
Author
Owner

@yp05327 commented on GitHub (Feb 7, 2024):

And these shouldn't be JSONError? IIRC, Flash will not work in this case.

@yp05327 commented on GitHub (Feb 7, 2024): And these shouldn't be `JSONError`? IIRC, `Flash` will not work in this case.
Author
Owner

@lunny commented on GitHub (Feb 7, 2024):

This only affects v1.22, not v1.21.5 I'm wrong. It's backported.

@lunny commented on GitHub (Feb 7, 2024): ~This only affects v1.22, not v1.21.5~ I'm wrong. It's backported.
Author
Owner

@TheBrokenRail commented on GitHub (Feb 7, 2024):

So from my understanding, this issue is really two issues?

  1. Gitea isn't detecting the merge conflict correctly, and says it's ready to merge when it isn't.
  2. When it does fails to merge, Gitea doesn't display the error correctly.
@TheBrokenRail commented on GitHub (Feb 7, 2024): So from my understanding, this issue is really two issues? 1. Gitea isn't detecting the merge conflict correctly, and says it's ready to merge when it isn't. 2. When it does fails to merge, Gitea doesn't display the error correctly.
Author
Owner

@Zettat123 commented on GitHub (Feb 21, 2024):

this issue is really two issues?

Yes. There are two issues.

  1. The issue of error display. Caused by the bug mentioned in comment

  2. As for the conflict detection failure, that's not a bug. Currently Gitea only detects conflicts with the "merge" method, not with the "rebase" method. I think Gitea should also detect conflicts with "rebase" and add some error messages to inform users that there are conflicts when using "rebase", like GitHub does.

@Zettat123 commented on GitHub (Feb 21, 2024): > this issue is really two issues? Yes. There are two issues. 1. The issue of error display. Caused by the bug mentioned in [comment](https://github.com/go-gitea/gitea/issues/29071#issuecomment-1931261075) 3. As for the conflict detection failure, that's not a bug. Currently Gitea only detects conflicts with the "merge" method, not with the "rebase" method. I think Gitea should also detect conflicts with "rebase" and add some error messages to inform users that there are conflicts when using "rebase", like GitHub does. <img width="640px" src="https://github.com/go-gitea/gitea/assets/15528715/d08c2323-2e3c-4fa2-ad60-2ff4f5576df3" />
Author
Owner

@wxiaoguang commented on GitHub (Feb 21, 2024):

wait for backport

@wxiaoguang commented on GitHub (Feb 21, 2024): wait for backport
Author
Owner

@lunny commented on GitHub (Feb 22, 2024):

Closed by #29309

@lunny commented on GitHub (Feb 22, 2024): Closed by #29309
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12445