Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion models/repo_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func SearchRepository(opts *SearchRepoOptions) (RepositoryList, int64, error) {
}

if opts.AllPublic {
accessCond = accessCond.Or(builder.Eq{"is_private": false})
accessCond = accessCond.Or(builder.Eq{"is_private": false}).And(builder.In("owner_id", builder.Select("id").From("user").Where(builder.Lte{"visibility": 1})))
}

cond = cond.And(accessCond)
Expand Down
2 changes: 1 addition & 1 deletion models/repo_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestSearchRepository(t *testing.T) {
count: 25},
{name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborative",
opts: &SearchRepoOptions{Page: 1, PageSize: 10, OwnerID: 15, Private: true, AllPublic: true, Template: util.OptionalBoolFalse},
count: 31},
count: 30},
{name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborativeByName",
opts: &SearchRepoOptions{Keyword: "test", Page: 1, PageSize: 10, OwnerID: 15, Private: true, AllPublic: true},
count: 15},
Expand Down