@@ -454,10 +454,21 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
454
454
AllPublic : false ,
455
455
AllLimited : false ,
456
456
}
457
-
458
457
if team != nil {
459
458
repoOpts .TeamID = team .ID
460
459
}
460
+ {
461
+ ids , _ , err := repo_model .SearchRepositoryIDs (repoOpts )
462
+ if err != nil {
463
+ ctx .ServerError ("SearchRepositoryIDs" , err )
464
+ return
465
+ }
466
+ opts .RepoIDs = ids
467
+ if len (opts .RepoIDs ) == 0 {
468
+ // no repos found, don't let the indexer return all repos
469
+ opts .RepoIDs = []int64 {0 }
470
+ }
471
+ }
461
472
462
473
switch filterMode {
463
474
case issues_model .FilterModeAll :
@@ -541,15 +552,13 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
541
552
// Parse ctx.FormString("repos") and remember matched repo IDs for later.
542
553
// Gets set when clicking filters on the issues overview page.
543
554
repoIDs := getRepoIDs (ctx .FormString ("repos" ))
544
- if len (repoIDs ) == 0 {
545
- repoIDs = accessibleRepos .Values ()
546
- } else {
555
+ if len (repoIDs ) > 0 {
547
556
// Remove repo IDs that are not accessible to the user.
548
557
repoIDs = util .SliceRemoveAllFunc (repoIDs , func (v int64 ) bool {
549
558
return ! accessibleRepos .Contains (v )
550
559
})
560
+ opts .RepoIDs = repoIDs
551
561
}
552
- opts .RepoIDs = repoIDs
553
562
554
563
// ------------------------------
555
564
// Get issues as defined by opts.
@@ -609,6 +618,7 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
609
618
var issueStats * issues_model.IssueStats
610
619
{
611
620
statsOpts := issues_model.IssuesOptions {
621
+ RepoIDs : repoIDs ,
612
622
User : ctx .Doer ,
613
623
IsPull : util .OptionalBoolOf (isPullList ),
614
624
IsClosed : util .OptionalBoolOf (isShowClosed ),
0 commit comments