Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8a4b29d

Browse files
authoredJun 8, 2023
Merge branch 'main' into deps-54
2 parents e27a66f + 0d47b0a commit 8a4b29d

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed
 

‎services/repository/branch.go

-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"code.gitea.io/gitea/modules/log"
1818
"code.gitea.io/gitea/modules/notification"
1919
repo_module "code.gitea.io/gitea/modules/repository"
20-
pull_service "code.gitea.io/gitea/services/pull"
2120
)
2221

2322
// CreateNewBranch creates a new repository branch
@@ -181,10 +180,6 @@ func DeleteBranch(ctx context.Context, doer *user_model.User, repo *repo_model.R
181180
return err
182181
}
183182

184-
if err := pull_service.CloseBranchPulls(doer, repo.ID, branchName); err != nil {
185-
return err
186-
}
187-
188183
// Don't return error below this
189184
if err := PushUpdate(
190185
&repo_module.PushUpdateOptions{
@@ -199,9 +194,5 @@ func DeleteBranch(ctx context.Context, doer *user_model.User, repo *repo_model.R
199194
log.Error("Update: %v", err)
200195
}
201196

202-
if err := git_model.AddDeletedBranch(ctx, repo.ID, branchName, commit.ID.String(), doer.ID); err != nil {
203-
log.Warn("AddDeletedBranch: %v", err)
204-
}
205-
206197
return nil
207198
}

‎services/repository/push.go

+3
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
273273
// close all related pulls
274274
log.Error("close related pull request failed: %v", err)
275275
}
276+
if err := git_model.AddDeletedBranch(db.DefaultContext, repo.ID, branch, opts.OldCommitID, pusher.ID); err != nil {
277+
log.Warn("AddDeletedBranch: %v", err)
278+
}
276279
}
277280

278281
// Even if user delete a branch on a repository which he didn't watch, he will be watch that.

0 commit comments

Comments
 (0)
Please sign in to comment.