Files
gitea/services
6bc0e8cd57 fix(pull): recover PRs whose recorded merge commit never reached the base repo (#39831) (#39840)
Backport #39831 by @lunny

When pushing the merge commit to the base repo fails (e.g.
non-fast-forward), the merge intent recorded by
https://github.com/go-gitea/gitea/pull/39442 is left behind.
`merged_commit_id` then points to a commit that does not exist in the
base repo, and `git branch --contains` fails with `no such commit`, so
the PR can never be checked or merged again.

- Clear the recorded merge intent if the push fails and the commit is
not on the base branch
- `IsCommitInBranch` now returns false for a missing commit, so
already-stuck PRs recover on the next check

Fixes: https://github.com/go-gitea/gitea/issues/39824
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2026-10-18 03:24:11 -07:00
..
2026-09-12 08:15:23 +00:00
2026-09-12 08:15:23 +00:00
2026-09-12 08:15:23 +00:00
2026-09-12 16:26:20 +00:00
2026-09-23 23:14:31 +00:00
2026-08-26 19:32:44 +00:00
2026-09-12 08:15:23 +00:00
2026-09-12 08:15:23 +00:00
2026-09-12 08:15:23 +00:00