mirror of
https://github.com/go-gitea/gitea
synced 2025-08-03 08:08:36 +00:00
Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
@@ -46,6 +46,10 @@ func DeleteRepo(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if ctx.Repo != nil && ctx.Repo.GitRepo != nil && ctx.Repo.Repository != nil && ctx.Repo.Repository.ID == repo.ID {
|
||||
ctx.Repo.GitRepo.Close()
|
||||
}
|
||||
|
||||
if err := repo_service.DeleteRepository(ctx.User, repo); err != nil {
|
||||
ctx.ServerError("DeleteRepository", err)
|
||||
return
|
||||
|
@@ -885,6 +885,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
|
||||
|
@@ -539,6 +539,11 @@ func SettingsPost(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// Close the gitrepository before doing this.
|
||||
if ctx.Repo.GitRepo != nil {
|
||||
ctx.Repo.GitRepo.Close()
|
||||
}
|
||||
|
||||
if err := repo_service.DeleteRepository(ctx.User, ctx.Repo.Repository); err != nil {
|
||||
ctx.ServerError("DeleteRepository", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user