1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-04 01:27:20 +00:00
This commit is contained in:
Lunny Xiao
2024-11-04 20:42:20 -08:00
parent 499eb515fc
commit 47c9581a80

View File

@ -24,6 +24,7 @@ import (
"code.gitea.io/gitea/modules/queue" "code.gitea.io/gitea/modules/queue"
notify_service "code.gitea.io/gitea/services/notify" notify_service "code.gitea.io/gitea/services/notify"
pull_service "code.gitea.io/gitea/services/pull" pull_service "code.gitea.io/gitea/services/pull"
repo_service "code.gitea.io/gitea/services/repository"
) )
// prAutoMergeQueue represents a queue to handle update pull request tests // prAutoMergeQueue represents a queue to handle update pull request tests
@ -303,4 +304,10 @@ func handlePullRequestAutoMerge(pullID int64, sha string) {
// on the pull request page. But this should not be finished in a bug fix PR which will be backport to release branch. // on the pull request page. But this should not be finished in a bug fix PR which will be backport to release branch.
return return
} }
if pr.Flow == issues_model.PullRequestFlowGithub && scheduledPRM.DeleteBranchAfterMerge {
if err := repo_service.DeleteBranch(ctx, doer, pr.HeadRepo, headGitRepo, pr.HeadBranch); err != nil {
log.Error("deleteBranch after automerge for pull[%d] failed: %v", pr.ID, err)
}
}
} }