diff --git a/services/pull/check.go b/services/pull/check.go index c877cc84e..ea91f3a86 100644 --- a/services/pull/check.go +++ b/services/pull/check.go @@ -61,7 +61,7 @@ func checkAndUpdateStatus(pr *models.PullRequest) { } if !has { - if err := pr.UpdateCols("merge_base", "status", "conflicted_files"); err != nil { + if err := pr.UpdateColsIfNotMerged("merge_base", "status", "conflicted_files"); err != nil { log.Error("Update[%d]: %v", pr.ID, err) } } diff --git a/services/pull/pull.go b/services/pull/pull.go index 5c7ec91f5..ce5c4ff22 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -120,7 +120,7 @@ func ChangeTargetBranch(pr *models.PullRequest, doer *models.User, targetBranch if pr.Status == models.PullRequestStatusChecking { pr.Status = models.PullRequestStatusMergeable } - if err := pr.UpdateCols("status, conflicted_files, base_branch"); err != nil { + if err := pr.UpdateColsIfNotMerged("merge_base", "status", "conflicted_files", "base_branch"); err != nil { return err }