1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-05 10:07:22 +00:00

Add abstraction layer to delete repository from disk (#33879)

Extract from #28966 
Follow #33874
This commit is contained in:
Lunny Xiao
2025-03-14 11:38:55 -07:00
committed by GitHub
parent a0e0a30d23
commit 55cc649d3d
6 changed files with 37 additions and 11 deletions

View File

@ -116,7 +116,7 @@ func ForkRepository(ctx context.Context, doer, owner *user_model.User, opts Fork
// As the transaction will be failed and hence database changes will be destroyed we only need
// to delete the related repository on the filesystem
if errDelete := util.RemoveAll(repo.RepoPath()); errDelete != nil {
if errDelete := gitrepo.DeleteRepository(ctx, repo); errDelete != nil {
log.Error("Failed to remove fork repo")
}
}