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:
authorDouwe Maan <douwe@selenight.nl>2017-02-24 18:32:10 +0300
committerDouwe Maan <douwe@selenight.nl>2017-02-24 18:55:01 +0300
commita530e9da3580e05a171b3ba0a3f4408afc000b10 (patch)
tree49e3787d12d2e7d3a40e3cdf1af0ff8643ac99e1 /app/services/files
parent9e39b317a3865688e9fb204fb8680d3e91958fec (diff)
Address review
Diffstat (limited to 'app/services/files')
-rw-r--r--app/services/files/multi_service.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/services/files/multi_service.rb b/app/services/files/multi_service.rb
index 809fa32eca5..2c89f6e7f92 100644
--- a/app/services/files/multi_service.rb
+++ b/app/services/files/multi_service.rb
@@ -22,6 +22,12 @@ module Files
def validate
super
params[:actions].each_with_index do |action, index|
+ if ACTIONS.include?(action[:action].to_s)
+ action[:action] = action[:action].to_sym
+ else
+ raise_error("Unknown action type `#{action[:action]}`.")
+ end
+
unless action[:file_path].present?
raise_error("You must specify a file_path.")
end
@@ -32,12 +38,6 @@ module Files
regex_check(action[:file_path])
regex_check(action[:previous_path]) if action[:previous_path]
- if ACTIONS.include?(action[:action].to_s)
- action[:action] = action[:action].to_sym
- else
- raise_error("Unknown action type `#{action[:action]}`.")
- end
-
if project.empty_repo? && action[:action] != :create
raise_error("No files to #{action[:action]}.")
end