mirror of https://github.com/go-gitea/gitea.git
Fix #36905 The changes focus on force-push PR timeline handling and commit range calculation: - Reworked pull-request push comment creation to use a new `gitrepo.GetCommitIDsBetweenReverse` helper, with special handling for force pushes (merge-base based range, tolerate missing/invalid old commits, and keep force-push timeline entries). - Added `Comment.GetPushActionContent` to parse push comment payloads and used it to delete only non-force-push push comments during force pushes. - Removed the old `Repository.CommitsBetweenNotBase` helper from `modules/git/repo_commit.go` in favor of the new commit ID range helper. - Added tests for `GetCommitIDsBetweenReverse` (normal range, `notRef` filtering, fallback branch usage) and expanded pull comment tests to cover force-push edge cases. <img width="989" height="563" alt="image" src="https://github.com/user-attachments/assets/a01e1bc2-fa8a-4028-8a35-d484e601ff3b" /> --------- Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com> Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> |
||
|---|---|---|
| .. | ||
| archive.go | ||
| blame.go | ||
| blame_sha256_test.go | ||
| blame_test.go | ||
| branch.go | ||
| cat_file.go | ||
| clone.go | ||
| command.go | ||
| commit.go | ||
| commit_file.go | ||
| commit_file_test.go | ||
| commit_test.go | ||
| commitgraph.go | ||
| compare.go | ||
| compare_test.go | ||
| config.go | ||
| diff.go | ||
| fetch.go | ||
| fsck.go | ||
| gitrepo.go | ||
| hooks.go | ||
| main_test.go | ||
| merge.go | ||
| merge_tree.go | ||
| merge_tree_test.go | ||
| push.go | ||
| ref.go | ||
| remote.go | ||
| repo_lock.go | ||
| signing.go | ||
| size.go | ||
| tag.go | ||
| url.go | ||
| walk_gogit.go | ||
| walk_nogogit.go | ||