summaryrefslogtreecommitdiffstats
path: root/services/repository/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/repository/repository.go')
-rw-r--r--services/repository/repository.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/repository/repository.go b/services/repository/repository.go
index eea8b352b4..f50b98b640 100644
--- a/services/repository/repository.go
+++ b/services/repository/repository.go
@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
repo_module "code.gitea.io/gitea/modules/repository"
+ pull_service "code.gitea.io/gitea/services/pull"
)
// CreateRepository creates a repository for the user/organization.
@@ -49,6 +50,10 @@ func ForkRepository(doer, u *models.User, oldRepo *models.Repository, name, desc
// DeleteRepository deletes a repository for a user or organization.
func DeleteRepository(doer *models.User, repo *models.Repository) error {
+ if err := pull_service.CloseRepoBranchesPulls(doer, repo); err != nil {
+ log.Error("CloseRepoBranchesPulls failed: %v", err)
+ }
+
if err := models.DeleteRepository(doer, repo.OwnerID, repo.ID); err != nil {
return err
}