Extract a do_execute method to be overridden
This commit is contained in:
parent
ec31fa260b
commit
a7225111b1
|
@ -3,6 +3,12 @@ module MergeRequests
|
|||
def execute(oldrev, newrev, ref)
|
||||
return true unless Gitlab::Git.branch_ref?(ref)
|
||||
|
||||
do_execute(oldrev, newrev, ref)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def do_execute(oldrev, newrev, ref)
|
||||
@oldrev, @newrev = oldrev, newrev
|
||||
@branch_name = Gitlab::Git.ref_name(ref)
|
||||
|
||||
|
@ -28,8 +34,6 @@ module MergeRequests
|
|||
true
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def close_upon_missing_source_branch_ref
|
||||
# MergeRequest#reload_diff ignores not opened MRs. This means it won't
|
||||
# create an `empty` diff for `closed` MRs without a source branch, keeping
|
||||
|
|
Loading…
Reference in New Issue