Skip to content

Commit 36df987

Browse files
committed
Remove redudant condition
1 parent 0bfaa07 commit 36df987

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

models/repo_list.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,6 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (repos RepositoryList, _ in
177177

178178
// Include collaborative repositories
179179
if opts.Collaborate {
180-
// Get owner organizations
181-
orgs, err := GetOrgUsersByUserID(opts.OwnerID, opts.Private)
182-
183-
if err != nil {
184-
return nil, 0, fmt.Errorf("Organization: %v", err)
185-
}
186-
187-
var ownerIds []int64
188-
for _, org := range orgs {
189-
ownerIds = append(ownerIds, org.OrgID)
190-
}
191-
192-
// Add repositories from related organizations
193-
accessCond = accessCond.Or(builder.And(builder.In("owner_id", ownerIds), builder.Eq{"is_private": false}))
194-
195180
// Add repositories where user is set as collaborator directly
196181
accessCond = accessCond.Or(builder.Expr("id IN (SELECT repo_id FROM `access` WHERE access.user_id = ? AND owner_id != ?)",
197182
opts.OwnerID, opts.OwnerID))

0 commit comments

Comments
 (0)