Skip to content

Commit 02b947a

Browse files
authored
Fix View File button link if branch deleted on pull request files pages (#31063) (#31077)
1 parent 7b73182 commit 02b947a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/web/repo/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ func viewPullFiles(ctx *context.Context, specifiedStartCommit, specifiedEndCommi
862862
}
863863

864864
if pull.HeadRepo != nil {
865-
ctx.Data["SourcePath"] = pull.HeadRepo.Link() + "/src/branch/" + util.PathEscapeSegments(pull.HeadBranch)
865+
ctx.Data["SourcePath"] = pull.HeadRepo.Link() + "/src/commit/" + endCommitID
866866

867867
if !pull.HasMerged && ctx.Doer != nil {
868868
perm, err := access_model.GetUserRepoPermission(ctx, pull.HeadRepo, ctx.Doer)

0 commit comments

Comments
 (0)