diff options
author | zeripath | 2020-04-01 13:33:44 +0100 |
---|---|---|
committer | GitHub | 2020-04-01 15:33:44 +0300 |
commit | bfce841b04a7d1d101ecb84e567e02e4ea33806a (patch) | |
tree | f9c2c4075681cd0a275dae518ef0e62061bc66c5 | |
parent | 139fc7cfee2b872a99a1866ded8bc1f9a43c4c20 (diff) |
Only update merge_base if not already merged (#10909)
* Only update merge_base if not already merged
Fix #10766
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent race in transfer pull request
* Update services/pull/pull.go
-rw-r--r-- | services/pull/check.go | 2 | ||||
-rw-r--r-- | services/pull/pull.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/services/pull/check.go b/services/pull/check.go index e2f39ce16..9ed8f3a08 100644 --- a/services/pull/check.go +++ b/services/pull/check.go @@ -47,7 +47,7 @@ func checkAndUpdateStatus(pr *models.PullRequest) { // Make sure there is no waiting test to process before leaving the checking status. if !pullRequestQueue.Exist(pr.ID) { - 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 2a09c98bf..57e33ec5b 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -115,7 +115,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 } |