Fix duplicated branch creation/deletion events when using Web UI
When deleting a branch, this is what was happening:
1. DeleteBranchService calls EventCreateService and creates an event.
2. The call to repository.rm_branch triggers the GitHooksService.
3. This, in turn, calls GitPushService and then calls EventCreateService again.
5145706c
now makes it no longer necessary for DeleteBranchService and CreateBranchService to create an event.
Closes #4304
This commit is contained in:
parent
b1539116f6
commit
423d2d621a
|
@ -28,6 +28,7 @@ v 8.4.0 (unreleased)
|
||||||
- Ajax filter by message for commits page
|
- Ajax filter by message for commits page
|
||||||
|
|
||||||
v 8.3.3 (unreleased)
|
v 8.3.3 (unreleased)
|
||||||
|
- Fix duplicated branch creation/deletion events when using Web UI (Stan Hu)
|
||||||
- Get "Merge when build succeeds" to work when commits were pushed to MR target branch while builds were running
|
- Get "Merge when build succeeds" to work when commits were pushed to MR target branch while builds were running
|
||||||
- Fix project transfer e-mail sending incorrect paths in e-mail notification (Stan Hu)
|
- Fix project transfer e-mail sending incorrect paths in e-mail notification (Stan Hu)
|
||||||
- Enable "Add key" button when user fills in a proper key (Stan Hu)
|
- Enable "Add key" button when user fills in a proper key (Stan Hu)
|
||||||
|
|
|
@ -31,7 +31,6 @@ class CreateBranchService < BaseService
|
||||||
if new_branch
|
if new_branch
|
||||||
push_data = build_push_data(project, current_user, new_branch)
|
push_data = build_push_data(project, current_user, new_branch)
|
||||||
|
|
||||||
EventCreateService.new.push(project, current_user, push_data)
|
|
||||||
project.execute_hooks(push_data.dup, :push_hooks)
|
project.execute_hooks(push_data.dup, :push_hooks)
|
||||||
project.execute_services(push_data.dup, :push_hooks)
|
project.execute_services(push_data.dup, :push_hooks)
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ class DeleteBranchService < BaseService
|
||||||
if repository.rm_branch(current_user, branch_name)
|
if repository.rm_branch(current_user, branch_name)
|
||||||
push_data = build_push_data(branch)
|
push_data = build_push_data(branch)
|
||||||
|
|
||||||
EventCreateService.new.push(project, current_user, push_data)
|
|
||||||
project.execute_hooks(push_data.dup, :push_hooks)
|
project.execute_hooks(push_data.dup, :push_hooks)
|
||||||
project.execute_services(push_data.dup, :push_hooks)
|
project.execute_services(push_data.dup, :push_hooks)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue