fix: redirect from /{username}/{reponame}/pulls/{index} to issue if index is a issue (#8874)

Redirection from issue to pull is already working, but from pull to issue is not working. This is now fixed.

Resolves forgejo/forgejo#7386

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8874
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: zokki <zokki.softwareschmiede@gmail.com>
Co-committed-by: zokki <zokki.softwareschmiede@gmail.com>
This commit is contained in:
zokki 2025-08-12 20:50:46 +02:00 committed by Gusted
commit fb1095d141
2 changed files with 33 additions and 1 deletions

View file

@ -360,7 +360,7 @@ func getPullInfo(ctx *context.Context) (issue *issues_model.Issue, ok bool) {
ctx.Data["Issue"] = issue
if !issue.IsPull {
ctx.NotFound("ViewPullCommits", nil)
ctx.Redirect(issue.Link())
return nil, false
}