diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-04-19 23:16:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 11:16:46 -0400 |
commit | 15d6638c155fabcfed5a24d87f84bc1902774ce1 (patch) | |
tree | 53167f6ae3193a93ee73f8581129501d60e6a9ec /routers | |
parent | f30cc9faa93935f5afb7a38354e5381d5e8825bf (diff) | |
download | gitea-15d6638c155fabcfed5a24d87f84bc1902774ce1.tar.gz gitea-15d6638c155fabcfed5a24d87f84bc1902774ce1.zip |
Don't list root repository on compare page if pulls not allowed (#24183)
Fix #24165
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/compare.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index 92abe0ce25..0ca1f90547 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) |