From 467e4e81f4876433ef30602fe75944a8ab16693a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 13 Nov 2013 14:17:03 +0200 Subject: [PATCH] Dont show last push widget if user removed this branch Signed-off-by: Dmitriy Zaporozhets --- app/helpers/application_helper.rb | 3 +++ 1 file changed, 3 insertions(+) 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