aboutsummaryrefslogtreecommitdiffstats
path: root/routers/private/hook_post_receive.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-12-10 09:27:50 +0800
committerGitHub <noreply@github.com>2021-12-10 09:27:50 +0800
commit719bddcd76610a63dadc8555760072957a11cf30 (patch)
tree0df26092fba7e3e21444fe493e6b349473b6b0cb /routers/private/hook_post_receive.go
parentfb8166c6c6b652a0e6fa98681780a6a71090faf3 (diff)
downloadgitea-719bddcd76610a63dadc8555760072957a11cf30.tar.gz
gitea-719bddcd76610a63dadc8555760072957a11cf30.zip
Move repository model into models/repo (#17933)
* Some refactors related repository model * Move more methods out of repository * Move repository into models/repo * Fix test * Fix test * some improvements * Remove unnecessary function
Diffstat (limited to 'routers/private/hook_post_receive.go')
-rw-r--r--routers/private/hook_post_receive.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/private/hook_post_receive.go b/routers/private/hook_post_receive.go
index 0d559250ea..a71f465911 100644
--- a/routers/private/hook_post_receive.go
+++ b/routers/private/hook_post_receive.go
@@ -11,6 +11,7 @@ import (
"strings"
"code.gitea.io/gitea/models"
+ repo_model "code.gitea.io/gitea/models/repo"
gitea_context "code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
@@ -35,7 +36,7 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
repoName := ctx.Params(":repo")
// defer getting the repository at this point - as we should only retrieve it if we're going to call update
- var repo *models.Repository
+ var repo *repo_model.Repository
updates := make([]*repo_module.PushUpdateOptions, 0, len(opts.OldCommitIDs))
wasEmpty := false
@@ -116,7 +117,7 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
// We have to reload the repo in case its state is changed above
repo = nil
- var baseRepo *models.Repository
+ var baseRepo *repo_model.Repository
// Now handle the pull request notification trailers
for i := range opts.OldCommitIDs {