mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08:00 
			
		
		
		
	Close the gitrepo when deleting the repository (#15876)
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user