Commit 79f0858a18081d37669883f1b5a32d033197561d
1 parent
c2f10400
Exists in
master
and in
4 other branches
Services and hooks MUST BE executed on branch push!
Showing
1 changed file
with
7 additions
and
0 deletions
Show diff stats
app/services/git_push_service.rb
| ... | ... | @@ -30,6 +30,9 @@ class GitPushService |
| 30 | 30 | if push_to_existing_branch?(ref, oldrev) |
| 31 | 31 | project.update_merge_requests(oldrev, newrev, ref, @user) |
| 32 | 32 | process_commit_messages(ref) |
| 33 | + end | |
| 34 | + | |
| 35 | + if push_to_branch?(ref) | |
| 33 | 36 | project.execute_hooks(@push_data.dup) |
| 34 | 37 | project.execute_services(@push_data.dup) |
| 35 | 38 | end |
| ... | ... | @@ -175,6 +178,10 @@ class GitPushService |
| 175 | 178 | ref_parts[1] =~ /heads/ && oldrev == "0000000000000000000000000000000000000000" |
| 176 | 179 | end |
| 177 | 180 | |
| 181 | + def push_to_branch? ref | |
| 182 | + ref =~ /refs\/heads/ | |
| 183 | + end | |
| 184 | + | |
| 178 | 185 | def is_default_branch? ref |
| 179 | 186 | ref == "refs/heads/#{project.default_branch}" |
| 180 | 187 | end | ... | ... |