Class: Gitlab::BranchPushMergeCommitAnalyzer::CommitDecorator

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/gitlab/branch_push_merge_commit_analyzer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#direct_ancestor=(value) ⇒ Object (writeonly)

boolean


54
55
56
# File 'lib/gitlab/branch_push_merge_commit_analyzer.rb', line 54

def direct_ancestor=(value)
  @direct_ancestor = value
end

#merge_commitObject

Returns the value of attribute merge_commit


53
54
55
# File 'lib/gitlab/branch_push_merge_commit_analyzer.rb', line 53

def merge_commit
  @merge_commit
end

Instance Method Details

#direct_ancestor?Boolean

Returns:

  • (Boolean)

56
57
58
# File 'lib/gitlab/branch_push_merge_commit_analyzer.rb', line 56

def direct_ancestor?
  @direct_ancestor
end

#set_merge_commit(child_commit:) ⇒ Object

Parameters:

  • child_commit (CommitDecorator)
  • first_parent (Boolean)

    whether `self` is the first parent of `child_commit`


62
63
64
# File 'lib/gitlab/branch_push_merge_commit_analyzer.rb', line 62

def set_merge_commit(child_commit:)
  @merge_commit ||= direct_ancestor? ? self : child_commit.merge_commit
end