mirror of
https://github.com/go-gitea/gitea
synced 2025-07-09 20:17:21 +00:00
Move hooks function to gitrepo and reduce expose repopath (#33890)
Extract from #28966 Follow #33874
This commit is contained in:
@ -12,7 +12,6 @@ import (
|
||||
"code.gitea.io/gitea/models/webhook"
|
||||
"code.gitea.io/gitea/modules/gitrepo"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
repo_module "code.gitea.io/gitea/modules/repository"
|
||||
|
||||
"xorm.io/builder"
|
||||
)
|
||||
@ -32,11 +31,11 @@ func SyncRepositoryHooks(ctx context.Context) error {
|
||||
default:
|
||||
}
|
||||
|
||||
if err := repo_module.CreateDelegateHooks(repo.RepoPath()); err != nil {
|
||||
if err := gitrepo.CreateDelegateHooksForRepo(ctx, repo); err != nil {
|
||||
return fmt.Errorf("SyncRepositoryHook: %w", err)
|
||||
}
|
||||
if repo.HasWiki() {
|
||||
if err := repo_module.CreateDelegateHooks(repo.WikiPath()); err != nil {
|
||||
if err := gitrepo.CreateDelegateHooksForWiki(ctx, repo); err != nil {
|
||||
return fmt.Errorf("SyncRepositoryHook: %w", err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user