|
|
|
@ -863,21 +863,21 @@ func viewPullFiles(ctx *context.Context, specifiedStartCommit, specifiedEndCommi |
|
|
|
|
|
|
|
|
|
if pull.HeadRepo != nil { |
|
|
|
|
ctx.Data["SourcePath"] = pull.HeadRepo.Link() + "/src/branch/" + util.PathEscapeSegments(pull.HeadBranch) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if !pull.HasMerged && ctx.Doer != nil { |
|
|
|
|
perm, err := access_model.GetUserRepoPermission(ctx, pull.HeadRepo, ctx.Doer) |
|
|
|
|
if err != nil { |
|
|
|
|
ctx.ServerError("GetUserRepoPermission", err) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if !pull.HasMerged && ctx.Doer != nil { |
|
|
|
|
perm, err := access_model.GetUserRepoPermission(ctx, pull.HeadRepo, ctx.Doer) |
|
|
|
|
if err != nil { |
|
|
|
|
ctx.ServerError("GetUserRepoPermission", err) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if perm.CanWrite(unit.TypeCode) || issues_model.CanMaintainerWriteToBranch(ctx, perm, pull.HeadBranch, ctx.Doer) { |
|
|
|
|
ctx.Data["CanEditFile"] = true |
|
|
|
|
ctx.Data["EditFileTooltip"] = ctx.Tr("repo.editor.edit_this_file") |
|
|
|
|
ctx.Data["HeadRepoLink"] = pull.HeadRepo.Link() |
|
|
|
|
ctx.Data["HeadBranchName"] = pull.HeadBranch |
|
|
|
|
ctx.Data["BackToLink"] = setting.AppSubURL + ctx.Req.URL.RequestURI() |
|
|
|
|
if perm.CanWrite(unit.TypeCode) || issues_model.CanMaintainerWriteToBranch(ctx, perm, pull.HeadBranch, ctx.Doer) { |
|
|
|
|
ctx.Data["CanEditFile"] = true |
|
|
|
|
ctx.Data["EditFileTooltip"] = ctx.Tr("repo.editor.edit_this_file") |
|
|
|
|
ctx.Data["HeadRepoLink"] = pull.HeadRepo.Link() |
|
|
|
|
ctx.Data["HeadBranchName"] = pull.HeadBranch |
|
|
|
|
ctx.Data["BackToLink"] = setting.AppSubURL + ctx.Req.URL.RequestURI() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|