mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-09 04:30:16 +09:00
69a2bfcfbd
Backport #39613 by @dziulatex Fixes #39598 When the base branch has "Block merge if the pull request is outdated" enabled, an AGit pull request that fell behind could never be unblocked: merging the base branch into the topic and pushing it again to the same `refs/for/<branch>/<topic>` left the PR "blocked because it's outdated" forever. The outdated block reads the stored `commits_behind`. Pushing a branch refreshes it for GitHub-flow PRs (`AddTestPullRequestTask`), but the AGit update path in `services/agit` moved `refs/pull/N/head` without recomputing it, so the value only changed when the base branch was pushed, which is the event that makes a PR behind again. The AGit update path now calls `syncCommitDivergence` in `UpdateRefForAgit`, the same as AGit PR creation (`NewPullRequest`) already does. Signed-off-by: dziulatex <paweldziurasoftware@yahoo.com> Co-authored-by: dziulatex <38464243+dziulatex@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>