diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-12-08 12:08:25 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-12-08 12:08:25 +0300 |
commit | 3fa3fcd7876262bb63966debd04d16ea219fad73 (patch) | |
tree | 8ccb4823ba9d9a47e8ee7d6514c274c223288f80 /app/services | |
parent | 691f1c496834078ba41209597558259d20790a0b (diff) |
Cleanup parameters, easier to understand and
more consistent across different methodst
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/commits/change_service.rb | 2 | ||||
-rw-r--r-- | app/services/files/create_dir_service.rb | 6 | ||||
-rw-r--r-- | app/services/files/create_service.rb | 8 | ||||
-rw-r--r-- | app/services/files/delete_service.rb | 6 | ||||
-rw-r--r-- | app/services/files/multi_service.rb | 4 | ||||
-rw-r--r-- | app/services/files/update_service.rb | 6 | ||||
-rw-r--r-- | app/services/git_operation_service.rb | 16 |
7 files changed, 24 insertions, 24 deletions
diff --git a/app/services/commits/change_service.rb b/app/services/commits/change_service.rb index 5458f7a6790..d49fcd42a08 100644 --- a/app/services/commits/change_service.rb +++ b/app/services/commits/change_service.rb @@ -37,7 +37,7 @@ module Commits @commit, into, tree_id, - source_branch: @target_branch) + source_branch_name: @target_branch) success else diff --git a/app/services/files/create_dir_service.rb b/app/services/files/create_dir_service.rb index f0bb3333db8..4a2b2e8fcaf 100644 --- a/app/services/files/create_dir_service.rb +++ b/app/services/files/create_dir_service.rb @@ -4,11 +4,11 @@ module Files repository.commit_dir( current_user, @file_path, - @commit_message, - @target_branch, + message: @commit_message, + branch_name: @target_branch, author_email: @author_email, author_name: @author_name, - source_branch: @source_branch) + source_branch_name: @source_branch) end def validate diff --git a/app/services/files/create_service.rb b/app/services/files/create_service.rb index 65f7baf56fd..c95cb75f7cb 100644 --- a/app/services/files/create_service.rb +++ b/app/services/files/create_service.rb @@ -5,12 +5,12 @@ module Files current_user, @file_path, @file_content, - @commit_message, - @target_branch, - false, + message: @commit_message, + branch_name: @target_branch, + update: false, author_email: @author_email, author_name: @author_name, - source_branch: @source_branch) + source_branch_name: @source_branch) end def validate diff --git a/app/services/files/delete_service.rb b/app/services/files/delete_service.rb index b3f323d0173..45a9a559469 100644 --- a/app/services/files/delete_service.rb +++ b/app/services/files/delete_service.rb @@ -4,11 +4,11 @@ module Files repository.remove_file( current_user, @file_path, - @commit_message, - @target_branch, + message: @commit_message, + branch_name: @target_branch, author_email: @author_email, author_name: @author_name, - source_branch: @source_branch) + source_branch_name: @source_branch) end end end diff --git a/app/services/files/multi_service.rb b/app/services/files/multi_service.rb index 6f5f25f88fd..42ed97ca3c0 100644 --- a/app/services/files/multi_service.rb +++ b/app/services/files/multi_service.rb @@ -5,12 +5,12 @@ module Files def commit repository.multi_action( user: current_user, - branch: @target_branch, message: @commit_message, + branch_name: @target_branch, actions: params[:actions], author_email: @author_email, author_name: @author_name, - source_branch: @source_branch + source_branch_name: @source_branch ) end diff --git a/app/services/files/update_service.rb b/app/services/files/update_service.rb index 67d473d4978..5f671817cdb 100644 --- a/app/services/files/update_service.rb +++ b/app/services/files/update_service.rb @@ -4,13 +4,13 @@ module Files def commit repository.update_file(current_user, @file_path, @file_content, - branch: @target_branch, - previous_path: @previous_path, message: @commit_message, + branch_name: @target_branch, + previous_path: @previous_path, author_email: @author_email, author_name: @author_name, source_project: @source_project, - source_branch: @source_branch) + source_branch_name: @source_branch) end private diff --git a/app/services/git_operation_service.rb b/app/services/git_operation_service.rb index 3a102a9276b..c8504ecf3cd 100644 --- a/app/services/git_operation_service.rb +++ b/app/services/git_operation_service.rb @@ -25,23 +25,23 @@ GitOperationService = Struct.new(:user, :repository) do end end - # Whenever `source_branch` is passed, if `branch` doesn't exist, - # it would be created from `source_branch`. + # Whenever `source_branch_name` is passed, if `branch_name` doesn't exist, + # it would be created from `source_branch_name`. # If `source_project` is passed, and the branch doesn't exist, # it would try to find the source from it instead of current repository. def with_branch( branch_name, - source_branch: nil, + source_branch_name: nil, source_project: repository.project) - check_with_branch_arguments!(branch_name, source_branch, source_project) + check_with_branch_arguments!( + branch_name, source_branch_name, source_project) - update_branch_with_hooks( - branch_name, source_branch, source_project) do |ref| + update_branch_with_hooks(branch_name) do |ref| if repository.project != source_project repository.fetch_ref( source_project.repository.path_to_repo, - "#{Gitlab::Git::BRANCH_REF_PREFIX}#{source_branch}", + "#{Gitlab::Git::BRANCH_REF_PREFIX}#{source_branch_name}", "#{Gitlab::Git::BRANCH_REF_PREFIX}#{branch_name}" ) end @@ -52,7 +52,7 @@ GitOperationService = Struct.new(:user, :repository) do private - def update_branch_with_hooks(branch_name, source_branch, source_project) + def update_branch_with_hooks(branch_name) update_autocrlf_option ref = Gitlab::Git::BRANCH_REF_PREFIX + branch_name |