diff options
-rw-r--r-- | app/models/merge_request.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index da293c3738f..acaf14a12e9 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -569,17 +569,14 @@ class MergeRequest < ActiveRecord::Base end def issues_mentioned_but_not_closing(current_user = self.author) - issues = [] - closing_issues = [] + return [] unless target_branch == project.default_branch - if target_branch == project.default_branch - ext = Gitlab::ReferenceExtractor.new(project, current_user) - ext.analyze(description) + ext = Gitlab::ReferenceExtractor.new(project, current_user) + ext.analyze(description) - issues = ext.issues - closing_issues = Gitlab::ClosingIssueExtractor.new(project, current_user). - closed_by_message(description) - end + issues = ext.issues + closing_issues = Gitlab::ClosingIssueExtractor.new(project, current_user). + closed_by_message(description) issues - closing_issues end |