From dd1a651b5895cfdb8a141a56aa824ed4d082c41a Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 11 Sep 2020 22:14:48 +0800 Subject: 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 Co-authored-by: techknowlogick --- routers/repo/pull.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'routers/repo/pull.go') diff --git a/routers/repo/pull.go b/routers/repo/pull.go index a19dbb5cb3..a6f7a70744 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -22,7 +22,6 @@ import ( "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification" - "code.gitea.io/gitea/modules/repofiles" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/util" @@ -1124,10 +1123,8 @@ func CleanUpPullRequest(ctx *context.Context) { return } - if err := repofiles.PushUpdate( - pr.HeadRepo, - pr.HeadBranch, - repofiles.PushUpdateOptions{ + if err := repo_service.PushUpdate( + &repo_service.PushUpdateOptions{ RefFullName: git.BranchPrefix + pr.HeadBranch, OldCommitID: branchCommitID, NewCommitID: git.EmptySHA, -- cgit v1.2.3