This commit is contained in:
Lunny Xiao 2024-04-23 17:11:46 +08:00
parent db6e278871
commit a5d0708fdd
1 changed files with 0 additions and 10 deletions

View File

@ -65,16 +65,6 @@ func addToQueue(pr *issues_model.PullRequest, sha string) {
// ScheduleAutoMerge if schedule is false and no error, pull can be merged directly
func ScheduleAutoMerge(ctx context.Context, doer *user_model.User, pull *issues_model.PullRequest, style repo_model.MergeStyle, message string) (scheduled bool, err error) {
err = db.WithTx(ctx, func(ctx context.Context) error {
lastCommitStatus, err := pull_service.GetPullRequestCommitStatusState(ctx, pull)
if err != nil {
return err
}
// we don't need to schedule
if lastCommitStatus.IsSuccess() {
return nil
}
if err := pull_model.ScheduleAutoMerge(ctx, doer, pull.ID, style, message); err != nil {
return err
}