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
Fix #24165
  • Loading branch information
lunny committed Apr 19, 2023
1 parent f30cc9f commit 15d6638
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 15d6638

Please sign in to comment.