Move createrepository from module to service layer (#26927)
Repository creation depends on many models, so moving it to service layer is better.
This commit is contained in:
parent
b3d88ada01
commit
b9df9fa2e2
26 changed files with 510 additions and 482 deletions
|
@ -241,7 +241,7 @@ func generateRepoCommit(ctx context.Context, repo, templateRepo, generateRepo *r
|
|||
defaultBranch = templateRepo.DefaultBranch
|
||||
}
|
||||
|
||||
return initRepoCommit(ctx, tmpDir, repo, repo.Owner, defaultBranch)
|
||||
return InitRepoCommit(ctx, tmpDir, repo, repo.Owner, defaultBranch)
|
||||
}
|
||||
|
||||
func generateGitContent(ctx context.Context, repo, templateRepo, generateRepo *repo_model.Repository) (err error) {
|
||||
|
@ -356,7 +356,7 @@ func GenerateRepository(ctx context.Context, doer, owner *user_model.User, templ
|
|||
}
|
||||
}
|
||||
|
||||
if err = checkInitRepository(ctx, owner.Name, generateRepo.Name); err != nil {
|
||||
if err = CheckInitRepository(ctx, owner.Name, generateRepo.Name); err != nil {
|
||||
return generateRepo, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue