-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow maintainers to view and edit files of private repos when "Allow maintainers to edit" is enabled #32215
Conversation
@@ -887,8 +887,6 @@ func viewPullFiles(ctx *context.Context, specifiedStartCommit, specifiedEndCommi | |||
} | |||
|
|||
if pull.HeadRepo != nil { | |||
ctx.Data["SourcePath"] = pull.HeadRepo.Link() + "/src/commit/" + endCommitID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to edit SourcePath
here. Its value is already set by the setCompareContext
.
gitea/routers/web/repo/pull.go
Line 834 in 8bee7fc
setCompareContext(ctx, baseCommit, commit, ctx.Repo.Owner.Name, ctx.Repo.Repository.Name) |
And if we use the link of head repo here, the maintainer of the base repository won't be able to view the file.
Should we also change |
I checked the references of
See b02fffe |
* giteaofficial/main: Make `owner/repo/pulls` handlers use "PR reader" permission (go-gitea#32254) make `show stats` work when only one file changed (go-gitea#32244) Update scheduled tasks even if changes are pushed by "ActionsUser" (go-gitea#32246) Support migrating GitHub/GitLab PR draft status (go-gitea#32242) Only rename a user when they should receive a different name (go-gitea#32247) Fix dropdown content overflow (go-gitea#31610) Make git push options accept short name (go-gitea#32245) Allow code search by filename (go-gitea#32210) Allow maintainers to view and edit files of private repos when "Allow maintainers to edit" is enabled (go-gitea#32215) Use per package global lock for container uploads instead of memory lock (go-gitea#31860)
Fix #31539