diff options
author | zeripath <art27@cantab.net> | 2021-05-14 21:19:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-14 21:19:38 +0100 |
commit | d0ea10b21fb252c4f82a193b62a776e482e4bdfb (patch) | |
tree | 6cded84ee822eec2faf916e7b3d4f765190c4f4c /routers/repo/setting.go | |
parent | f6be429781b24b1ac3b6e719b9c64df33866db93 (diff) | |
download | gitea-d0ea10b21fb252c4f82a193b62a776e482e4bdfb.tar.gz gitea-d0ea10b21fb252c4f82a193b62a776e482e4bdfb.zip |
Close the gitrepo when deleting the repository (#15876)
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/repo/setting.go')
-rw-r--r-- | routers/repo/setting.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go index b37ac03112..51bf68b15b 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -544,6 +544,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 |