From 8172d5ca54f908d5ce9975dd18fb9bea0c992dbb Mon Sep 17 00:00:00 2001 From: Nemanja Boric <4burgos@gmail.com> Date: Wed, 10 Feb 2016 23:52:39 +0100 Subject: [PATCH] Don't try to mark broken MR as mergable In case merge request is broken, we shouldn't check if the sha is mergable, as it will be null, and there's no point, as we know that it's not mergable. --- app/models/merge_request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 345b9a26d4e..1be8061e53d 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -241,7 +241,7 @@ class MergeRequest < ActiveRecord::Base return unless unchecked? can_be_merged = - project.repository.can_be_merged?(source_sha, target_branch) + !broken? && project.repository.can_be_merged?(source_sha, target_branch) if can_be_merged mark_as_mergeable