Commit a7225111 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Extract a do_execute method to be overridden

parent ec31fa26
...@@ -3,6 +3,12 @@ module MergeRequests ...@@ -3,6 +3,12 @@ module MergeRequests
def execute(oldrev, newrev, ref) def execute(oldrev, newrev, ref)
return true unless Gitlab::Git.branch_ref?(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 @oldrev, @newrev = oldrev, newrev
@branch_name = Gitlab::Git.ref_name(ref) @branch_name = Gitlab::Git.ref_name(ref)
...@@ -28,8 +34,6 @@ module MergeRequests ...@@ -28,8 +34,6 @@ module MergeRequests
true true
end end
private
def close_upon_missing_source_branch_ref def close_upon_missing_source_branch_ref
# MergeRequest#reload_diff ignores not opened MRs. This means it won't # MergeRequest#reload_diff ignores not opened MRs. This means it won't
# create an `empty` diff for `closed` MRs without a source branch, keeping # create an `empty` diff for `closed` MRs without a source branch, keeping
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment