@@ -15,6 +15,7 @@ import (
1515 repo_model "code.gitea.io/gitea/models/repo"
1616 user_model "code.gitea.io/gitea/models/user"
1717 "code.gitea.io/gitea/modules/git"
18+ "code.gitea.io/gitea/modules/gitrepo"
1819 "code.gitea.io/gitea/modules/lfs"
1920 "code.gitea.io/gitea/modules/log"
2021 "code.gitea.io/gitea/modules/migration"
@@ -264,17 +265,16 @@ func cleanUpMigrateGitConfig(ctx context.Context, repoPath string) error {
264265
265266// CleanUpMigrateInfo finishes migrating repository and/or wiki with things that don't need to be done for mirrors.
266267func CleanUpMigrateInfo (ctx context.Context , repo * repo_model.Repository ) (* repo_model.Repository , error ) {
267- repoPath := repo .RepoPath ()
268- if err := repo_module .CreateDelegateHooks (repoPath ); err != nil {
268+ if err := gitrepo .CreateDelegateHooks (ctx , repo , false ); err != nil {
269269 return repo , fmt .Errorf ("createDelegateHooks: %w" , err )
270270 }
271271 if repo .HasWiki () {
272- if err := repo_module .CreateDelegateHooks (repo . WikiPath () ); err != nil {
272+ if err := gitrepo .CreateDelegateHooks (ctx , repo , true ); err != nil {
273273 return repo , fmt .Errorf ("createDelegateHooks.(wiki): %w" , err )
274274 }
275275 }
276276
277- _ , _ , err := git .NewCommand ("remote" , "rm" , "origin" ).RunStdString (ctx , & git.RunOpts {Dir : repoPath })
277+ _ , _ , err := git .NewCommand ("remote" , "rm" , "origin" ).RunStdString (ctx , & git.RunOpts {Dir : repo . RepoPath () })
278278 if err != nil && ! git .IsRemoteNotExistError (err ) {
279279 return repo , fmt .Errorf ("CleanUpMigrateInfo: %w" , err )
280280 }
0 commit comments