0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-10-23 05:54:41 -04:00

Move some functions from package git to gitrepo (#33910)

Follow #33874
This commit is contained in:
Lunny Xiao
2025-09-01 12:13:18 -07:00
committed by GitHub
parent d2e994db2c
commit 1717af72c4
9 changed files with 32 additions and 23 deletions

View File

@@ -142,7 +142,7 @@ func prepareRepoCommit(ctx context.Context, repo *repo_model.Repository, tmpDir
// InitRepository initializes README and .gitignore if needed.
func initRepository(ctx context.Context, u *user_model.User, repo *repo_model.Repository, opts CreateRepoOptions) (err error) {
// Init git bare new repository.
if err = git.InitRepository(ctx, repo.RepoPath(), true, repo.ObjectFormatName); err != nil {
if err = gitrepo.InitRepository(ctx, repo, repo.ObjectFormatName); err != nil {
return fmt.Errorf("git.InitRepository: %w", err)
} else if err = gitrepo.CreateDelegateHooks(ctx, repo); err != nil {
return fmt.Errorf("createDelegateHooks: %w", err)