diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-12-10 09:27:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 09:27:50 +0800 |
commit | 719bddcd76610a63dadc8555760072957a11cf30 (patch) | |
tree | 0df26092fba7e3e21444fe493e6b349473b6b0cb /services/repository/hooks.go | |
parent | fb8166c6c6b652a0e6fa98681780a6a71090faf3 (diff) | |
download | gitea-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 'services/repository/hooks.go')
-rw-r--r-- | services/repository/hooks.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/repository/hooks.go b/services/repository/hooks.go index a50853f6af..714cd6b2eb 100644 --- a/services/repository/hooks.go +++ b/services/repository/hooks.go @@ -8,8 +8,8 @@ import ( "context" "fmt" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" + repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/modules/log" repo_module "code.gitea.io/gitea/modules/repository" @@ -23,10 +23,10 @@ func SyncRepositoryHooks(ctx context.Context) error { if err := db.Iterate( db.DefaultContext, - new(models.Repository), + new(repo_model.Repository), builder.Gt{"id": 0}, func(idx int, bean interface{}) error { - repo := bean.(*models.Repository) + repo := bean.(*repo_model.Repository) select { case <-ctx.Done(): return db.ErrCancelledf("before sync repository hooks for %s", repo.FullName()) |