提交 154f474b 编写于 作者: A Ash McKenzie

Merge branch 'reduce-parse-options-complexity' into 'master'

Refactor parse_options() in push_options.rb

Closes #67091

See merge request gitlab-org/gitlab-ce!32756
...@@ -56,6 +56,13 @@ module Gitlab ...@@ -56,6 +56,13 @@ module Gitlab
next if [namespace, key].any?(&:nil?) next if [namespace, key].any?(&:nil?)
store_option_info(options, namespace, key, value)
end
options
end
def store_option_info(options, namespace, key, value)
options[namespace] ||= HashWithIndifferentAccess.new options[namespace] ||= HashWithIndifferentAccess.new
if option_multi_value?(namespace, key) if option_multi_value?(namespace, key)
...@@ -66,9 +73,6 @@ module Gitlab ...@@ -66,9 +73,6 @@ module Gitlab
end end
end end
options
end
def option_multi_value?(namespace, key) def option_multi_value?(namespace, key)
MULTI_VALUE_OPTIONS.any? { |arr| arr == [namespace, key] } MULTI_VALUE_OPTIONS.any? { |arr| arr == [namespace, key] }
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册