diff options
author | Jonathon Reinhart <Jonathon.Reinhart@gmail.com> | 2018-12-30 22:31:35 -0500 |
---|---|---|
committer | Gabriel Mazetto <brodock@gmail.com> | 2019-04-25 13:54:26 +0200 |
commit | f48605c796bf9098370a258e00fce41f1770ff74 (patch) | |
tree | 8ecd4ec10090264fa9bb9aacb29dab2b21a51839 /lib/gitlab/data_builder | |
parent | 8a07d5e60faffcdf090376a1957be8703253e7ce (diff) | |
download | gitlab-ce-f48605c796bf9098370a258e00fce41f1770ff74.tar.gz |
Use all keyword args for DataBuilder::Push.build()
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 |