diff options
author | Stan Hu <stanhu@gmail.com> | 2016-02-08 21:52:00 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-02-09 06:22:49 -0800 |
commit | 4603e5714705da75fda4ef4857c327ac4b087848 (patch) | |
tree | 8371b1292afca3a3cab722fe3aabe3fe6988777a /app | |
parent | 706b101f510b9a1f5acff51bb2f1b14c018b37ce (diff) | |
download | gitlab-ce-4603e5714705da75fda4ef4857c327ac4b087848.tar.gz |
Fix duplicated branch creation/deletion Web hooks/service notifications when using Web UI
Similar to 423d2d6, except duplicates occurred only if a Web service (e.g. Slack) were
configured.
When deleting a branch, this is what was happening:
1. DeleteBranchService calls execute_hooks and execute_services
2. The call to repository.rm_branch triggers the GitHooksService.
3. This, in turn, calls GitPushService and then calls the same hooks/services again.
5145706 now makes it no longer necessary for DeleteBranchService and CreateBranchService to execute
the branch hooks/services. Note that tags behave differently in GitTagPushService and GitPushService
is not called.
Closes #10330
Diffstat (limited to 'app')
-rw-r--r-- | app/services/create_branch_service.rb | 6 | ||||
-rw-r--r-- | app/services/delete_branch_service.rb | 6 |
2 files changed, 2 insertions, 10 deletions
diff --git a/app/services/create_branch_service.rb b/app/services/create_branch_service.rb index c0e08a151f2..707c2f7ff85 100644 --- a/app/services/create_branch_service.rb +++ b/app/services/create_branch_service.rb @@ -29,11 +29,7 @@ class CreateBranchService < BaseService end if new_branch - push_data = build_push_data(project, current_user, new_branch) - - project.execute_hooks(push_data.dup, :push_hooks) - project.execute_services(push_data.dup, :push_hooks) - + # GitPushService handles execution of services and hooks for branch pushes success(new_branch) else error('Invalid reference name') diff --git a/app/services/delete_branch_service.rb b/app/services/delete_branch_service.rb index 004b3ce7286..fae069ee4a5 100644 --- a/app/services/delete_branch_service.rb +++ b/app/services/delete_branch_service.rb @@ -25,11 +25,7 @@ class DeleteBranchService < BaseService end if repository.rm_branch(current_user, branch_name) - push_data = build_push_data(branch) - - project.execute_hooks(push_data.dup, :push_hooks) - project.execute_services(push_data.dup, :push_hooks) - + # GitPushService handles execution of services and hooks for branch pushes success('Branch was removed') else error('Failed to remove branch') |