1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

move repository deletion to service layer (#26948)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Lunny Xiao
2023-09-08 12:51:15 +08:00
committed by GitHub
parent 3c0c279658
commit 4f32abaf94
53 changed files with 567 additions and 476 deletions

View File

@@ -170,7 +170,7 @@ func Migrate(ctx *context.APIContext) {
opts.Releases = false
}
repo, err := repo_service.CreateRepositoryDirectly(ctx.Doer, repoOwner, repo_service.CreateRepoOptions{
repo, err := repo_service.CreateRepositoryDirectly(ctx, ctx.Doer, repoOwner, repo_service.CreateRepoOptions{
Name: opts.RepoName,
Description: opts.Description,
OriginalURL: form.CloneAddr,
@@ -200,7 +200,7 @@ func Migrate(ctx *context.APIContext) {
}
if repo != nil {
if errDelete := models.DeleteRepository(ctx.Doer, repoOwner.ID, repo.ID); errDelete != nil {
if errDelete := repo_service.DeleteRepositoryDirectly(ctx, ctx.Doer, repoOwner.ID, repo.ID); errDelete != nil {
log.Error("DeleteRepository: %v", errDelete)
}
}