diff options
author | Gabriel Vasile <gabriel.vasile@email.com> | 2022-08-09 12:41:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-09 17:41:52 +0800 |
commit | 871082bc7b757bf9e1b5e2e389e7cd2f897608e5 (patch) | |
tree | 4cb7cf52a873c2c1a6c55ca903a6c44e5ad43064 /services | |
parent | fba20550f917a808846256d279ac3b4f9e302936 (diff) | |
download | gitea-871082bc7b757bf9e1b5e2e389e7cd2f897608e5.tar.gz gitea-871082bc7b757bf9e1b5e2e389e7cd2f897608e5.zip |
Remove manual rollback for failed generated repositories (#20639)
Generating repositories from a template is done inside a transaction.
Manual rollback on error is not needed and it always results in error
"repository does not exist".
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'services')
-rw-r--r-- | services/repository/template.go | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/services/repository/template.go b/services/repository/template.go index 3f2291ad63..b73abdce58 100644 --- a/services/repository/template.go +++ b/services/repository/template.go @@ -7,12 +7,10 @@ package repository import ( "context" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" issues_model "code.gitea.io/gitea/models/issues" repo_model "code.gitea.io/gitea/models/repo" user_model "code.gitea.io/gitea/models/user" - "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification" repo_module "code.gitea.io/gitea/modules/repository" ) @@ -100,11 +98,6 @@ func GenerateRepository(doer, owner *user_model.User, templateRepo *repo_model.R return nil }); err != nil { - if generateRepo != nil && generateRepo.ID > 0 { - if errDelete := models.DeleteRepository(doer, owner.ID, generateRepo.ID); errDelete != nil { - log.Error("Rollback deleteRepository: %v", errDelete) - } - } return nil, err } |