Class: Datadog::CI::Git::BaseBranchShaDetection::MergeBaseExtractor
- Defined in:
- lib/datadog/ci/git/base_branch_sha_detection/merge_base_extractor.rb
Instance Attribute Summary collapse
-
#base_branch ⇒ Object
readonly
Returns the value of attribute base_branch.
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(remote_name, source_branch, base_branch) ⇒ MergeBaseExtractor
constructor
A new instance of MergeBaseExtractor.
Constructor Details
#initialize(remote_name, source_branch, base_branch) ⇒ MergeBaseExtractor
Returns a new instance of MergeBaseExtractor.
12 13 14 15 16 |
# File 'lib/datadog/ci/git/base_branch_sha_detection/merge_base_extractor.rb', line 12 def initialize(remote_name, source_branch, base_branch) super(remote_name, source_branch) @base_branch = base_branch end |
Instance Attribute Details
#base_branch ⇒ Object (readonly)
Returns the value of attribute base_branch.
10 11 12 |
# File 'lib/datadog/ci/git/base_branch_sha_detection/merge_base_extractor.rb', line 10 def base_branch @base_branch end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 |
# File 'lib/datadog/ci/git/base_branch_sha_detection/merge_base_extractor.rb', line 18 def call check_and_fetch_branch(base_branch, remote_name) full_base_branch_name = "#{remote_name}/#{remove_remote_prefix(base_branch, remote_name)}" merge_base_sha(full_base_branch_name, source_branch) end |