diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index 92abe0ce2..0ca1f9054 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -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)