Files
gitea/services
Giteabot 69a2bfcfbd fix(pull): refresh commits behind when an AGit pull request is updated (#39613) (#39625)
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>
2026-10-06 11:27:16 +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
2026-09-23 23:14:31 +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