aboutsummaryrefslogtreecommitdiff
path: root/internal/db/pull.go
diff options
context:
space:
mode:
authorJoe Chen <jc@unknwon.io>2022-06-04 13:10:15 +0800
committerGitHub <noreply@github.com>2022-06-04 13:10:15 +0800
commit69827490e0f0e68b34e082321b4e328df7847d66 (patch)
tree37c210dcb5a9aa2b10320ce1222b10a5e30b5f48 /internal/db/pull.go
parent75e10445ca8ecd76f3950825ffd161c2fc32da6a (diff)
pull: ignore PR status check if head repository is missing (#7004)
Diffstat (limited to 'internal/db/pull.go')
-rw-r--r--internal/db/pull.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/db/pull.go b/internal/db/pull.go
index b1f751b8..7d5a9bec 100644
--- a/internal/db/pull.go
+++ b/internal/db/pull.go
@@ -621,11 +621,6 @@ func (pr *PullRequest) UpdateCols(cols ...string) error {
// UpdatePatch generates and saves a new patch.
func (pr *PullRequest) UpdatePatch() (err error) {
- if pr.HeadRepo == nil {
- log.Trace("PullRequest[%d].UpdatePatch: ignored corrupted data", pr.ID)
- return nil
- }
-
headGitRepo, err := git.Open(pr.HeadRepo.RepoPath())
if err != nil {
return fmt.Errorf("open repository: %v", err)
@@ -759,6 +754,11 @@ func (prs PullRequestList) LoadAttributes() error {
func addHeadRepoTasks(prs []*PullRequest) {
for _, pr := range prs {
+ if pr.HeadRepo == nil {
+ log.Trace("addHeadRepoTasks[%d]: missing head repository", pr.ID)
+ continue
+ }
+
log.Trace("addHeadRepoTasks[%d]: composing new test task", pr.ID)
if err := pr.UpdatePatch(); err != nil {
log.Error("UpdatePatch: %v", err)