1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-05 18:17:19 +00:00

Move hooks function to gitrepo and reduce expose repopath (#33890)

Extract from #28966 
Follow #33874
This commit is contained in:
Lunny Xiao
2025-03-16 09:12:55 -07:00
committed by GitHub
parent 1ea5216f4a
commit 7fd44a85ca
8 changed files with 38 additions and 24 deletions

View File

@ -138,7 +138,7 @@ func CheckInitRepository(ctx context.Context, repo *repo_model.Repository) (err
// Init git bare new repository.
if err = git.InitRepository(ctx, repo.RepoPath(), true, repo.ObjectFormatName); err != nil {
return fmt.Errorf("git.InitRepository: %w", err)
} else if err = CreateDelegateHooks(repo.RepoPath()); err != nil {
} else if err = gitrepo.CreateDelegateHooksForRepo(ctx, repo); err != nil {
return fmt.Errorf("createDelegateHooks: %w", err)
}
return nil