From 26095115f4ae90e3fdc6ab695978efd16e317f75 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 6 Jun 2022 16:01:49 +0800 Subject: Move some repository related code into sub package (#19711) * Move some repository related code into sub package * Move more repository functions out of models * Fix lint * Some performance optimization for webhooks and others * some refactors * Fix lint * Fix * Update modules/repository/delete.go Co-authored-by: delvh * Fix test * Merge * Fix test * Fix test * Fix test * Fix test Co-authored-by: delvh --- services/repository/adopt.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'services/repository/adopt.go') diff --git a/services/repository/adopt.go b/services/repository/adopt.go index 1e8c22a479..48f049cd28 100644 --- a/services/repository/adopt.go +++ b/services/repository/adopt.go @@ -73,7 +73,7 @@ func AdoptRepository(doer, u *user_model.User, opts models.CreateRepoOptions) (* if err := adoptRepository(ctx, repoPath, doer, repo, opts); err != nil { return fmt.Errorf("createDelegateHooks: %v", err) } - if err := models.CheckDaemonExportOK(ctx, repo); err != nil { + if err := repo_module.CheckDaemonExportOK(ctx, repo); err != nil { return fmt.Errorf("checkDaemonExportOK: %v", err) } @@ -182,7 +182,7 @@ func adoptRepository(ctx context.Context, repoPath string, u *user_model.User, r } } - if err = models.UpdateRepositoryCtx(ctx, repo, false); err != nil { + if err = repo_module.UpdateRepository(ctx, repo, false); err != nil { return fmt.Errorf("updateRepository: %v", err) } @@ -246,7 +246,7 @@ func checkUnadoptedRepositories(userName string, repoNamesToCheck []string, unad } return err } - repos, _, err := models.GetUserRepositories(&models.SearchRepoOptions{ + repos, _, err := repo_model.GetUserRepositories(&repo_model.SearchRepoOptions{ Actor: ctxUser, Private: true, ListOptions: db.ListOptions{ -- cgit v1.2.3