summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-10 13:50:23 +0800
committerGitHub <noreply@github.com>2020-01-10 13:50:23 +0800
commit8878cfa4a125348d92f8163988ac9d3279f27e75 (patch)
tree1a3d7dd1331f75d5ab1dd96f9320a7b154f10b93
parent17b844a3ecbe1dd74bbde750e6a0adea07d92caa (diff)
downloadgitea-8878cfa4a125348d92f8163988ac9d3279f27e75.tar.gz
gitea-8878cfa4a125348d92f8163988ac9d3279f27e75.zip
Fix lint (#9688)
-rw-r--r--models/pull_test.go2
-rw-r--r--services/pull/check.go4
2 files changed, 4 insertions, 2 deletions
diff --git a/models/pull_test.go b/models/pull_test.go
index 325818e0bf..153739f540 100644
--- a/models/pull_test.go
+++ b/models/pull_test.go
@@ -182,7 +182,7 @@ func TestPullRequest_UpdateCols(t *testing.T) {
BaseBranch: "baseBranch",
HeadBranch: "headBranch",
}
- pr.UpdateCols("head_branch")
+ assert.NoError(t, pr.UpdateCols("head_branch"))
pr = AssertExistsAndLoadBean(t, &PullRequest{ID: 1}).(*PullRequest)
assert.Equal(t, "master", pr.BaseBranch)
diff --git a/services/pull/check.go b/services/pull/check.go
index b1b9505823..c5d8a585cb 100644
--- a/services/pull/check.go
+++ b/services/pull/check.go
@@ -201,7 +201,9 @@ func TestPullRequests(ctx context.Context) {
} else if err = TestPatch(pr); err != nil {
log.Error("testPatch[%d]: %v", pr.ID, err)
pr.Status = models.PullRequestStatusError
- pr.UpdateCols("status")
+ if err := pr.UpdateCols("status"); err != nil {
+ log.Error("update pr [%d] status to PullRequestStatusError failed: %v", pr.ID, err)
+ }
continue
}
checkAndUpdateStatus(pr)