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