mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-09-08 08:33:27 +00: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:
parent
9c2a58456a
commit
49547ea158
2 changed files with 8 additions and 5 deletions
|
@ -353,14 +353,17 @@ func (pr *PullRequest) GetLastCommitStatus() (status *CommitStatus, err error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
repo := pr.HeadRepo
|
|
||||||
lastCommitID, err := headGitRepo.GetBranchCommitID(pr.HeadBranch)
|
lastCommitID, err := headGitRepo.GetBranchCommitID(pr.HeadBranch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var statusList []*CommitStatus
|
err = pr.LoadBaseRepo()
|
||||||
statusList, err = GetLatestCommitStatus(repo, lastCommitID, 0)
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
statusList, err := GetLatestCommitStatus(pr.BaseRepo, lastCommitID, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,8 +212,8 @@
|
||||||
<a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Title}}</a>
|
<a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Title}}</a>
|
||||||
|
|
||||||
{{if .IsPull }}
|
{{if .IsPull }}
|
||||||
{{if (index $.CommitStatus .ID)}}
|
{{if (index $.CommitStatus .PullRequest.ID)}}
|
||||||
{{template "repo/commit_status" (index $.CommitStatus .ID)}}
|
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue