Skip to content

Commit

Permalink
Don't list root repository on compare page if pulls not allowed (#24183
Browse files Browse the repository at this point in the history
…) (#24210)

Backport #24183 by @lunny

Fix #24165

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
GiteaBot and lunny committed Apr 19, 2023
1 parent 8cd5483 commit dc66cea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/web/repo/compare.go
Expand Up @@ -459,7 +459,7 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
rootRepo.ID != ci.HeadRepo.ID &&
rootRepo.ID != baseRepo.ID {
canRead := access_model.CheckRepoUnitUser(ctx, rootRepo, ctx.Doer, unit.TypeCode)
if canRead {
if canRead && rootRepo.AllowsPulls() {
ctx.Data["RootRepo"] = rootRepo
if !fileOnly {
branches, tags, err := getBranchesAndTagsForRepo(ctx, rootRepo)
Expand Down

0 comments on commit dc66cea

Please sign in to comment.