summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-04-29 14:43:56 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-04-29 14:43:56 +0000
commitf832b96ad7f36d3f8b0ed7cb8776ff301410af8e (patch)
tree417a6ff88c81c0c6e4f6898a2ed98249c3e09a85 /lib
parent17e8e8d3f43dda6114523a1fd15096cae3bd71d4 (diff)
parentf48605c796bf9098370a258e00fce41f1770ff74 (diff)
downloadgitlab-ce-f832b96ad7f36d3f8b0ed7cb8776ff301410af8e.tar.gz
Merge branch 'use-keyword-args-for-databuilder-push' into 'master'
Use keyword args for databuilder push See merge request gitlab-org/gitlab-ce!24088
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/data_builder/push.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/data_builder/push.rb b/lib/gitlab/data_builder/push.rb
index af385d7d4ca..40bda3410e1 100644
--- a/lib/gitlab/data_builder/push.rb
+++ b/lib/gitlab/data_builder/push.rb
@@ -58,7 +58,10 @@ module Gitlab
# }
#
# rubocop:disable Metrics/ParameterLists
- def build(project, user, oldrev, newrev, ref, commits = [], message = nil, commits_count: nil, push_options: {})
+ def build(
+ project:, user:, ref:, oldrev: nil, newrev: nil,
+ commits: [], commits_count: nil, message: nil, push_options: {})
+
commits = Array(commits)
# Total commits count
@@ -113,7 +116,12 @@ module Gitlab
ref = "#{Gitlab::Git::BRANCH_REF_PREFIX}#{project.default_branch}"
commits = project.repository.commits(project.default_branch.to_s, limit: 3)
- build(project, user, commits.last&.id, commits.first&.id, ref, commits)
+ build(project: project,
+ user: user,
+ oldrev: commits.last&.id,
+ newrev: commits.first&.id,
+ ref: ref,
+ commits: commits)
end
def sample_data