1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Close the gitrepo when deleting the repository (#15876)

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath
2021-05-14 21:19:38 +01:00
committed by GitHub
parent f6be429781
commit d0ea10b21f
4 changed files with 14 additions and 0 deletions

View File

@@ -889,6 +889,10 @@ func Delete(ctx *context.APIContext) {
return
}
if ctx.Repo.GitRepo != nil {
ctx.Repo.GitRepo.Close()
}
if err := repo_service.DeleteRepository(ctx.User, repo); err != nil {
ctx.Error(http.StatusInternalServerError, "DeleteRepository", err)
return