Skip to content

fix(repo): surface unrelated histories on Sync Fork - #39258

Open
r3wretrhy wants to merge 1 commit into
go-gitea:mainfrom
r3wretrhy:fix/sync-fork-unrelated-histories
Open

fix(repo): surface unrelated histories on Sync Fork#39258
r3wretrhy wants to merge 1 commit into
go-gitea:mainfrom
r3wretrhy:fix/sync-fork-unrelated-histories

Conversation

@r3wretrhy

Copy link
Copy Markdown
Contributor

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.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 7, 2026
@github-actions github-actions Bot added topic/repo Related to repositories type/bug labels Sep 7, 2026
@r3wretrhy
r3wretrhy force-pushed the fix/sync-fork-unrelated-histories branch from 4d4d598 to e2853e0 Compare September 7, 2026 12:06
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
r3wretrhy force-pushed the fix/sync-fork-unrelated-histories branch from e2853e0 to c45884f Compare September 7, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. topic/repo Related to repositories type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error 500 when git rebase fails on Sync Fork button

2 participants