mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-09 16:03:20 +02:00
Move hooks function to gitrepo and reduce expose repopath (#33890)
Extract from #28966 Follow #33874
This commit is contained in:
1 parent
1ea5216f4a
commit
7fd44a85ca
8 files changed
+38
-24
No files matched your search
@@ -41,7 +41,7 @@ func InitWiki(ctx context.Context, repo *repo_model.Repository) error {
|
||||
|
||||
if err := git.InitRepository(ctx, repo.WikiPath(), true, repo.ObjectFormatName); err != nil {
|
||||
return fmt.Errorf("InitRepository: %w", err)
|
||||
} else if err = repo_module.CreateDelegateHooks(repo.WikiPath()); err != nil {
|
||||
} else if err = gitrepo.CreateDelegateHooksForWiki(ctx, repo); err != nil {
|
||||
return fmt.Errorf("createDelegateHooks: %w", err)
|
||||
} else if _, _, err = git.NewCommand("symbolic-ref", "HEAD").AddDynamicArguments(git.BranchPrefix+repo.DefaultWikiBranch).RunStdString(ctx, &git.RunOpts{Dir: repo.WikiPath()}); err != nil {
|
||||
return fmt.Errorf("unable to set default wiki branch to %q: %w", repo.DefaultWikiBranch, err)
|
||||
|
||||
Reference in new issue
Block a user