mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-08-06 01:37:25 +08:00
Show correct commit status in PR list (#8316)
* Use correct index when fetching commit status Signed-off-by: Elias Norberg <elias@aisle.se> * Compare against base repo to avoid mismatch when merging from fork Signed-off-by: Elias Norberg <elias@aisle.se>
This commit is contained in:

committed by
Lunny Xiao

parent
9c2a58456a
commit
49547ea158
@ -353,14 +353,17 @@ func (pr *PullRequest) GetLastCommitStatus() (status *CommitStatus, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
repo := pr.HeadRepo
|
||||
lastCommitID, err := headGitRepo.GetBranchCommitID(pr.HeadBranch)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var statusList []*CommitStatus
|
||||
statusList, err = GetLatestCommitStatus(repo, lastCommitID, 0)
|
||||
err = pr.LoadBaseRepo()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
statusList, err := GetLatestCommitStatus(pr.BaseRepo, lastCommitID, 0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user