0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-05 13:49:10 +01:00

Don't list root repository on compare page if pulls not allowed (#24183)

Fix #24165
This commit is contained in:
Lunny Xiao 2023-04-19 23:16:46 +08:00 committed by GitHub
parent f30cc9faa9
commit 15d6638c15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -459,7 +459,7 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
rootRepo.ID != ci.HeadRepo.ID && rootRepo.ID != ci.HeadRepo.ID &&
rootRepo.ID != baseRepo.ID { rootRepo.ID != baseRepo.ID {
canRead := access_model.CheckRepoUnitUser(ctx, rootRepo, ctx.Doer, unit.TypeCode) canRead := access_model.CheckRepoUnitUser(ctx, rootRepo, ctx.Doer, unit.TypeCode)
if canRead { if canRead && rootRepo.AllowsPulls() {
ctx.Data["RootRepo"] = rootRepo ctx.Data["RootRepo"] = rootRepo
if !fileOnly { if !fileOnly {
branches, tags, err := getBranchesAndTagsForRepo(ctx, rootRepo) branches, tags, err := getBranchesAndTagsForRepo(ctx, rootRepo)