Skip to content

Commit 15d6638

Browse files
authoredApr 19, 2023
Don't list root repository on compare page if pulls not allowed (#24183)
Fix #24165
1 parent f30cc9f commit 15d6638

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎routers/web/repo/compare.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
459459
rootRepo.ID != ci.HeadRepo.ID &&
460460
rootRepo.ID != baseRepo.ID {
461461
canRead := access_model.CheckRepoUnitUser(ctx, rootRepo, ctx.Doer, unit.TypeCode)
462-
if canRead {
462+
if canRead && rootRepo.AllowsPulls() {
463463
ctx.Data["RootRepo"] = rootRepo
464464
if !fileOnly {
465465
branches, tags, err := getBranchesAndTagsForRepo(ctx, rootRepo)

0 commit comments

Comments
 (0)
Please sign in to comment.