Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-27 14:56:04 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-27 14:56:04 +0400
commit79f0858a18081d37669883f1b5a32d033197561d (patch)
treeb945d90f3af229592f736824f123712b11c57d5b
parentc2f104000615f1f68ca9be61825add098265053f (diff)
Services and hooks MUST BE executed on branch push!
-rw-r--r--app/services/git_push_service.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index e774b2276e8..9584f420ab3 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -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