diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index 4ceb52d03..aee349561 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -460,7 +460,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 && rootRepo.AllowsPulls() { + if canRead { ctx.Data["RootRepo"] = rootRepo if !fileOnly { branches, tags, err := getBranchesAndTagsForRepo(ctx, rootRepo) diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl index 3bb7c2e81..e4ae7d4dc 100644 --- a/templates/repo/diff/compare.tmpl +++ b/templates/repo/diff/compare.tmpl @@ -77,7 +77,7 @@
{{$OwnForkCompareName}}:{{.}}
{{end}} {{end}} - {{if .RootRepo}} + {{if and .RootRepo .RootRepo.AllowsPulls}} {{range .RootRepoBranches}}
{{$RootRepoCompareName}}:{{.}}
{{end}}