gitea/routers/private
Lunny Xiao ebf0c96940
Move database operations of merging a pull request to post receive hook and add a transaction ()
Merging PR may fail because of various problems. The pull request may
have a dirty state because there is no transaction when merging a pull
request. ref
https://github.com/go-gitea/gitea/pull/25741#issuecomment-2074126393

This PR moves all database update operations to post-receive handler for
merging a pull request and having a database transaction. That means if
database operations fail, then the git merging will fail, the git client
will get a fail result.

There are already many tests for pull request merging, so we don't need
to add a new one.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
..
tests/repos Fix verifyCommits error when push a new branch ()
actions.go Clean up log messages ()
default_branch.go Move get/set default branch from git package to gitrepo package to hide repopath ()
hook_post_receive.go Move database operations of merging a pull request to post receive hook and add a transaction ()
hook_post_receive_test.go Move database operations of merging a pull request to post receive hook and add a transaction ()
hook_pre_receive.go Make sure git version&feature are always prepared ()
hook_proc_receive.go Make sure git version&feature are always prepared ()
hook_verification.go Clean up log messages ()
hook_verification_test.go Adjust object format interface ()
internal.go Move context from modules to services ()
internal_repo.go Move context from modules to services ()
key.go Move context from modules to services ()
mail.go Clean up log messages ()
main_test.go make writing main test easier ()
manager.go Move context from modules to services ()
manager_process.go Move context from modules to services ()
manager_unix.go Move context from modules to services ()
manager_windows.go Move context from modules to services ()
restore_repo.go Move context from modules to services ()
serv.go Make sure git version&feature are always prepared ()
ssh_log.go Move context from modules to services ()