Skip to content

Commit 47c9581

Browse files
committed
Fix bug
1 parent 499eb51 commit 47c9581

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

services/automerge/automerge.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"code.gitea.io/gitea/modules/queue"
2525
notify_service "code.gitea.io/gitea/services/notify"
2626
pull_service "code.gitea.io/gitea/services/pull"
27+
repo_service "code.gitea.io/gitea/services/repository"
2728
)
2829

2930
// prAutoMergeQueue represents a queue to handle update pull request tests
@@ -303,4 +304,10 @@ func handlePullRequestAutoMerge(pullID int64, sha string) {
303304
// on the pull request page. But this should not be finished in a bug fix PR which will be backport to release branch.
304305
return
305306
}
307+
308+
if pr.Flow == issues_model.PullRequestFlowGithub && scheduledPRM.DeleteBranchAfterMerge {
309+
if err := repo_service.DeleteBranch(ctx, doer, pr.HeadRepo, headGitRepo, pr.HeadBranch); err != nil {
310+
log.Error("deleteBranch after automerge for pull[%d] failed: %v", pr.ID, err)
311+
}
312+
}
306313
}

0 commit comments

Comments
 (0)