diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-05-16 09:07:34 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-05-17 10:38:31 +0300 |
commit | c871fb58e79e1f5c63ec97fdc6f2fea28064012f (patch) | |
tree | eb85102d428a287b9e379c12cbc18e2600502243 | |
parent | 1d8ebcedb90016398d236e3f9c67126352f7b57e (diff) |
ruby: Remove unused `start_sha` parameter from `#with_branch`
Remove the unused `start_sha` parameter from `#with_branch`.
-rw-r--r-- | ruby/lib/gitlab/git/operation_service.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ruby/lib/gitlab/git/operation_service.rb b/ruby/lib/gitlab/git/operation_service.rb index 63985744e..586ad5077 100644 --- a/ruby/lib/gitlab/git/operation_service.rb +++ b/ruby/lib/gitlab/git/operation_service.rb @@ -25,25 +25,22 @@ module Gitlab @repository = new_repository end - # Whenever `start_branch_name` or `start_sha` is passed, if `branch_name` + # Whenever `start_branch_name` is passed, if `branch_name` # doesn't exist, it will be created from the commit pointed to by - # `start_branch_name` or `start_sha`. + # `start_branch_name`. def with_branch(branch_name, start_branch_name: nil, - start_sha: nil, force: false, &block) start_branch_name = nil if repository.empty? if start_branch_name.present? && !repository.branch_exists?(start_branch_name) raise ArgumentError, "Cannot find branch '#{start_branch_name}'" - elsif start_sha.present? && !repository.commit_id(start_sha) - raise ArgumentError, "Cannot find commit '#{start_sha}'" end update_branch_with_hooks(branch_name, force) do repository.with_repo_branch_commit( - start_sha.presence || start_branch_name.presence || branch_name, + start_branch_name.presence || branch_name, &block ) end |