Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/feature.rb')
-rw-r--r--lib/feature.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index f317e8cb2c5..5841828da0e 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -301,11 +301,11 @@ module Feature
end
def gate_specified?
- %i(user project group feature_group namespace).any? { |key| params.key?(key) }
+ %i(user project group feature_group namespace repository).any? { |key| params.key?(key) }
end
def targets
- [feature_group, users, projects, groups, namespaces].flatten.compact
+ [feature_group, users, projects, groups, namespaces, repositories].flatten.compact
end
private
@@ -350,6 +350,17 @@ module Feature
Namespace.without_project_namespaces.find_by_full_path(arg) || (raise UnknowTargetError, "#{arg} is not found!")
end
end
+
+ def repositories
+ return unless params.key?(:repository)
+
+ params[:repository].split(',').map do |arg|
+ container, _project, _type, _path = Gitlab::RepoPath.parse(arg)
+ raise UnknowTargetError, "#{arg} is not found!" if container.nil?
+
+ container.repository
+ end
+ end
end
end