summaryrefslogtreecommitdiff
path: root/app/services/files
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-12-08 17:08:25 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-12-08 17:08:25 +0800
commit3fa3fcd7876262bb63966debd04d16ea219fad73 (patch)
tree8ccb4823ba9d9a47e8ee7d6514c274c223288f80 /app/services/files
parent691f1c496834078ba41209597558259d20790a0b (diff)
downloadgitlab-ce-3fa3fcd7876262bb63966debd04d16ea219fad73.tar.gz
Cleanup parameters, easier to understand and
more consistent across different methodst
Diffstat (limited to 'app/services/files')
-rw-r--r--app/services/files/create_dir_service.rb6
-rw-r--r--app/services/files/create_service.rb8
-rw-r--r--app/services/files/delete_service.rb6
-rw-r--r--app/services/files/multi_service.rb4
-rw-r--r--app/services/files/update_service.rb6
5 files changed, 15 insertions, 15 deletions
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