1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 16:44:26 +00:00

Fix View File button link if branch deleted on pull request files pages (#31063)

as title
This commit is contained in:
metiftikci 2024-05-25 17:02:07 +03:00 committed by GitHub
parent ec771fdfcd
commit 47e715a70f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -862,7 +862,7 @@ func viewPullFiles(ctx *context.Context, specifiedStartCommit, specifiedEndCommi
} }
if pull.HeadRepo != nil { 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 { if !pull.HasMerged && ctx.Doer != nil {
perm, err := access_model.GetUserRepoPermission(ctx, pull.HeadRepo, ctx.Doer) perm, err := access_model.GetUserRepoPermission(ctx, pull.HeadRepo, ctx.Doer)