]> source.dussan.org Git - gitea.git/commitdiff
Fix `View File` button link if branch deleted on pull request files pages (#31063...
authorGiteabot <teabot@gitea.io>
Sun, 26 May 2024 14:07:17 +0000 (22:07 +0800)
committerGitHub <noreply@github.com>
Sun, 26 May 2024 14:07:17 +0000 (14:07 +0000)
routers/web/repo/pull.go

index bbdc6ca631aedc6f03999f5937648e17efe6fb99..92e0a1674e080c41a8eec61b1dbe464c7b5d79d4 100644 (file)
@@ -862,7 +862,7 @@ func viewPullFiles(ctx *context.Context, specifiedStartCommit, specifiedEndCommi
                }
 
                if pull.HeadRepo != nil {
-                       ctx.Data["SourcePath"] = pull.HeadRepo.Link() + "/src/branch/" + util.PathEscapeSegments(pull.HeadBranch)
+                       ctx.Data["SourcePath"] = pull.HeadRepo.Link() + "/src/commit/" + endCommitID
 
                        if !pull.HasMerged && ctx.Doer != nil {
                                perm, err := access_model.GetUserRepoPermission(ctx, pull.HeadRepo, ctx.Doer)