aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2024-05-26 22:07:17 +0800
committerGitHub <noreply@github.com>2024-05-26 14:07:17 +0000
commit02b947a15fa92809f80277c541f6cee69457cafb (patch)
tree41aacc555247915bb690086b91e821708d1e28ba
parent7b7318255e68ee7e4d0f5b1b8e5ef91cd72a59e5 (diff)
downloadgitea-02b947a15fa92809f80277c541f6cee69457cafb.tar.gz
gitea-02b947a15fa92809f80277c541f6cee69457cafb.zip
Fix `View File` button link if branch deleted on pull request files pages (#31063) (#31077)
-rw-r--r--routers/web/repo/pull.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go
index bbdc6ca631..92e0a1674e 100644
--- a/routers/web/repo/pull.go
+++ b/routers/web/repo/pull.go
@@ -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)