Skip to content

Commit 423d2d6

Browse files
committed
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. 5145706 now makes it no longer necessary for DeleteBranchService and CreateBranchService to create an event. Closes #4304
1 parent b153911 commit 423d2d6

File tree

3 files changed

+1
-2
lines changed

3 files changed

+1
-2
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ v 8.4.0 (unreleased)
2828
- Ajax filter by message for commits page
2929

3030
v 8.3.3 (unreleased)
31+
- Fix duplicated branch creation/deletion events when using Web UI (Stan Hu)
3132
- Get "Merge when build succeeds" to work when commits were pushed to MR target branch while builds were running
3233
- Fix project transfer e-mail sending incorrect paths in e-mail notification (Stan Hu)
3334
- Enable "Add key" button when user fills in a proper key (Stan Hu)

app/services/create_branch_service.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def execute(branch_name, ref, source_project: @project)
3131
if new_branch
3232
push_data = build_push_data(project, current_user, new_branch)
3333

34-
EventCreateService.new.push(project, current_user, push_data)
3534
project.execute_hooks(push_data.dup, :push_hooks)
3635
project.execute_services(push_data.dup, :push_hooks)
3736

app/services/delete_branch_service.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def execute(branch_name)
2727
if repository.rm_branch(current_user, branch_name)
2828
push_data = build_push_data(branch)
2929

30-
EventCreateService.new.push(project, current_user, push_data)
3130
project.execute_hooks(push_data.dup, :push_hooks)
3231
project.execute_services(push_data.dup, :push_hooks)
3332

0 commit comments

Comments
 (0)