mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-31 03:00:03 +02:00
Remove duplicated functions when deleting a branch (#25128)
Extract from #22743 `DeleteBranch` will trigger a push update event, so that `pull_service.CloseBranchPulls` has been invoked twice and `AddDeletedBranch` is better to be moved to push update then even user delete a branch via git command, it will also be triggered. Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
3bdd48016f
commit
0d47b0ab1d
2 changed files with 3 additions and 9 deletions
|
@ -273,6 +273,9 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
|
|||
// close all related pulls
|
||||
log.Error("close related pull request failed: %v", err)
|
||||
}
|
||||
if err := git_model.AddDeletedBranch(db.DefaultContext, repo.ID, branch, opts.OldCommitID, pusher.ID); err != nil {
|
||||
log.Warn("AddDeletedBranch: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Even if user delete a branch on a repository which he didn't watch, he will be watch that.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue