Skip to content

Commit dc66cea

Browse files
GiteaBotlunny
andauthored
Don't list root repository on compare page if pulls not allowed (#24183) (#24210)
Backport #24183 by @lunny Fix #24165 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent 8cd5483 commit dc66cea

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)