diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-04-29 14:43:56 +0000 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-04-29 14:43:56 +0000 |
commit | f832b96ad7f36d3f8b0ed7cb8776ff301410af8e (patch) | |
tree | 417a6ff88c81c0c6e4f6898a2ed98249c3e09a85 /lib/gitlab/data_builder | |
parent | 17e8e8d3f43dda6114523a1fd15096cae3bd71d4 (diff) | |
parent | f48605c796bf9098370a258e00fce41f1770ff74 (diff) | |
download | gitlab-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/gitlab/data_builder')
-rw-r--r-- | lib/gitlab/data_builder/push.rb | 12 |
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 |