fix(repo): surface unrelated histories on Sync Fork - #39258
Open
r3wretrhy wants to merge 1 commit into
Open
Conversation
r3wretrhy
force-pushed
the
fix/sync-fork-unrelated-histories
branch
from
September 7, 2026 12:06
4d4d598 to
e2853e0
Compare
Sync Fork mapped merge conflicts to a JSON error but left unrelated-histories as ServerError, so the UI showed a 500 HTML snippet. PR merge already maps this. Do the same on the web handler and return 409 from the API. Fixes go-gitea#36772 Assisted-by: Grok:grok-4 Signed-off-by: Zhaoqi Xu <lzy00419@outlook.com>
r3wretrhy
force-pushed
the
fix/sync-fork-unrelated-histories
branch
from
September 7, 2026 12:53
e2853e0 to
c45884f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sync Fork already maps merge conflicts to a JSON error. Unrelated histories still went through
ServerError, so the UI showed a 500 HTML snippet instead of the same user-facing message PR merge already uses (repo.pulls.unrelated_histories).The API path returned 500 for the same git error; PR merge returns 409. Match that.
Fixes #36772
AI assistance was used to locate the handler gap and draft the mapping. I reviewed and take responsibility for the change.