diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2018-01-03 22:47:25 -0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2018-01-05 15:17:53 -0300 |
commit | 0b07be594e932cd9eb135b82e10931495350cb21 (patch) | |
tree | 0d7bed9bba42b62870c058c007c8d7860d6ead3f /app/services/files | |
parent | 3d162d192ba2a57776de62b553a2a0a9a9245f8a (diff) | |
download | gitlab-ce-0b07be594e932cd9eb135b82e10931495350cb21.tar.gz |
Move git operations for multi_action into Gitlab::Git
Diffstat (limited to 'app/services/files')
-rw-r--r-- | app/services/files/multi_service.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/app/services/files/multi_service.rb b/app/services/files/multi_service.rb index 98a3e83c130..a03c59f569d 100644 --- a/app/services/files/multi_service.rb +++ b/app/services/files/multi_service.rb @@ -4,7 +4,7 @@ module Files def create_commit! repository.multi_action( - user: current_user, + current_user, message: @commit_message, branch_name: @branch_name, actions: params[:actions], @@ -13,6 +13,8 @@ module Files start_project: @start_project, start_branch_name: @start_branch ) + rescue ArgumentError => e + raise_error(e) end private @@ -20,16 +22,7 @@ module Files def validate! super - params[:actions].each do |action| - validate_action!(action) - validate_file_status!(action) - end - end - - def validate_action!(action) - unless Gitlab::Git::Index::ACTIONS.include?(action[:action].to_s) - raise_error("Unknown action '#{action[:action]}'") - end + params[:actions].each { |action| validate_file_status!(action) } end def validate_file_status!(action) |