diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-09-11 22:14:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-11 10:14:48 -0400 |
commit | dd1a651b5895cfdb8a141a56aa824ed4d082c41a (patch) | |
tree | c9d8f9adb0c0a9fb9af8623f1590275a395fa1c7 /routers/api/v1/repo | |
parent | 910947fbcd229abac9f507e266f94cb8864474cb (diff) | |
download | gitea-dd1a651b5895cfdb8a141a56aa824ed4d082c41a.tar.gz gitea-dd1a651b5895cfdb8a141a56aa824ed4d082c41a.zip |
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>
Diffstat (limited to 'routers/api/v1/repo')
-rw-r--r-- | routers/api/v1/repo/branch.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/routers/api/v1/repo/branch.go b/routers/api/v1/repo/branch.go index 90db597ef7..6c63bde948 100644 --- a/routers/api/v1/repo/branch.go +++ b/routers/api/v1/repo/branch.go @@ -14,9 +14,9 @@ import ( "code.gitea.io/gitea/modules/convert" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/repofiles" repo_module "code.gitea.io/gitea/modules/repository" api "code.gitea.io/gitea/modules/structs" + repo_service "code.gitea.io/gitea/services/repository" ) // GetBranch get a branch of a repository @@ -160,10 +160,8 @@ func DeleteBranch(ctx *context.APIContext) { } // Don't return error below this - if err := repofiles.PushUpdate( - ctx.Repo.Repository, - ctx.Repo.BranchName, - repofiles.PushUpdateOptions{ + if err := repo_service.PushUpdate( + &repo_service.PushUpdateOptions{ RefFullName: git.BranchPrefix + ctx.Repo.BranchName, OldCommitID: c.ID.String(), NewCommitID: git.EmptySHA, |