diff --git a/app/services/search/global_service.rb b/app/services/search/global_service.rb index aa9837038a6..d477a5d3c7e 100644 --- a/app/services/search/global_service.rb +++ b/app/services/search/global_service.rb @@ -9,7 +9,11 @@ module Search def execute group = Group.find_by(id: params[:group_id]) if params[:group_id].present? projects = ProjectsFinder.new.execute(current_user) - projects = projects.in_namespace(group.id) if group + + if group + ids = group.descendants.push(group.id) + projects = projects.in_namespace(ids) + end Gitlab::SearchResults.new(current_user, projects, params[:search]) end