diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-24 09:32:10 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-24 09:55:01 -0600 |
commit | a530e9da3580e05a171b3ba0a3f4408afc000b10 (patch) | |
tree | 49e3787d12d2e7d3a40e3cdf1af0ff8643ac99e1 /app/services/files | |
parent | 9e39b317a3865688e9fb204fb8680d3e91958fec (diff) | |
download | gitlab-ce-a530e9da3580e05a171b3ba0a3f4408afc000b10.tar.gz |
Address review
Diffstat (limited to 'app/services/files')
-rw-r--r-- | app/services/files/multi_service.rb | 12 |
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 |