Extract a do_execute method to be overridden

This commit is contained in:
Lin Jen-Shin 2018-05-24 22:38:48 +08:00
parent ec31fa260b
commit a7225111b1
1 changed files with 6 additions and 2 deletions

View File

@ -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