aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-04-01 13:02:11 +0100
committerGitHub <noreply@github.com>2020-04-01 15:02:11 +0300
commit408bc2c8b5de801887ccf9a9ccc2bb80e0739f2e (patch)
tree013c16490701fc2493d6c5120a4d1d2474972677 /services
parentfbb0880d3760243fd56985c5e822facd68f58ebe (diff)
downloadgitea-408bc2c8b5de801887ccf9a9ccc2bb80e0739f2e.tar.gz
gitea-408bc2c8b5de801887ccf9a9ccc2bb80e0739f2e.zip
Only update merge_base in checker if not already merged (#10908)
Fix #10766 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'services')
-rw-r--r--services/pull/check.go2
-rw-r--r--services/pull/pull.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/services/pull/check.go b/services/pull/check.go
index c877cc84ee..ea91f3a862 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 5c7ec91f5d..ce5c4ff22f 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
}