Commit 79f0858a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Services and hooks MUST BE executed on branch push!

parent c2f10400
......@@ -30,6 +30,9 @@ class GitPushService
if push_to_existing_branch?(ref, oldrev)
project.update_merge_requests(oldrev, newrev, ref, @user)
process_commit_messages(ref)
end
if push_to_branch?(ref)
project.execute_hooks(@push_data.dup)
project.execute_services(@push_data.dup)
end
......@@ -175,6 +178,10 @@ class GitPushService
ref_parts[1] =~ /heads/ && oldrev == "0000000000000000000000000000000000000000"
end
def push_to_branch? ref
ref =~ /refs\/heads/
end
def is_default_branch? ref
ref == "refs/heads/#{project.default_branch}"
end
......
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