diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ad9b2e85945..d8cbd8f0286 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -126,6 +126,9 @@ module ApplicationHelper # Skip if user already created appropriate MR return false if project.merge_requests.where(source_branch: event.branch_name).opened.any? + # Skip if user removed branch right after that + return false unless project.repository.branch_names.include?(event.branch_name) + true end