mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
Move all push update operations to a queue (#10133)
* Fix test * Add no queue for test only * improve code * Auto watch whatever branch operation * Fix lint * Rename noqueue to immediate * Remove old PushUpdate function * Fix tests Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
910947fbcd
commit
dd1a651b58
16 changed files with 552 additions and 585 deletions
|
@ -19,6 +19,7 @@ import (
|
|||
repo_module "code.gitea.io/gitea/modules/repository"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"code.gitea.io/gitea/routers/utils"
|
||||
repo_service "code.gitea.io/gitea/services/repository"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -118,10 +119,8 @@ func RestoreBranchPost(ctx *context.Context) {
|
|||
}
|
||||
|
||||
// Don't return error below this
|
||||
if err := repofiles.PushUpdate(
|
||||
ctx.Repo.Repository,
|
||||
deletedBranch.Name,
|
||||
repofiles.PushUpdateOptions{
|
||||
if err := repo_service.PushUpdate(
|
||||
&repo_service.PushUpdateOptions{
|
||||
RefFullName: git.BranchPrefix + deletedBranch.Name,
|
||||
OldCommitID: git.EmptySHA,
|
||||
NewCommitID: deletedBranch.Commit,
|
||||
|
@ -157,10 +156,8 @@ func deleteBranch(ctx *context.Context, branchName string) error {
|
|||
}
|
||||
|
||||
// Don't return error below this
|
||||
if err := repofiles.PushUpdate(
|
||||
ctx.Repo.Repository,
|
||||
branchName,
|
||||
repofiles.PushUpdateOptions{
|
||||
if err := repo_service.PushUpdate(
|
||||
&repo_service.PushUpdateOptions{
|
||||
RefFullName: git.BranchPrefix + branchName,
|
||||
OldCommitID: commit.ID.String(),
|
||||
NewCommitID: git.EmptySHA,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue