Skip to content

Commit bb46e7f

Browse files
committed
Compare against base repo to avoid mismatch when merging from fork
Signed-off-by: Elias Norberg <[email protected]>
1 parent c53521f commit bb46e7f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

models/pull.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,17 @@ func (pr *PullRequest) GetLastCommitStatus() (status *CommitStatus, err error) {
339339
return nil, err
340340
}
341341

342-
repo := pr.HeadRepo
343342
lastCommitID, err := headGitRepo.GetBranchCommitID(pr.HeadBranch)
344343
if err != nil {
345344
return nil, err
346345
}
347346

348-
var statusList []*CommitStatus
349-
statusList, err = GetLatestCommitStatus(repo, lastCommitID, 0)
347+
err = pr.GetBaseRepo()
348+
if err != nil {
349+
return nil, err
350+
}
351+
352+
statusList, err := GetLatestCommitStatus(pr.BaseRepo, lastCommitID, 0)
350353
if err != nil {
351354
return nil, err
352355
}

0 commit comments

Comments
 (0)