diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-10-30 13:21:23 +0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-10-30 13:21:23 +0300 |
commit | c4124fce48e83db603d69a83bb912ae5d0d54f65 (patch) | |
tree | 42c9a08bbeb0b47916624aa6d85fe29d74a20c3f /app | |
parent | 7e60c764282c84d4acea517903705a4c4e3a61f2 (diff) |
Move locked check to a guard-clause
Diffstat (limited to 'app')
-rw-r--r-- | app/models/merge_request.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index c952ab862d7..07352db5d2d 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -398,7 +398,9 @@ class MergeRequest < ActiveRecord::Base def merge_ongoing? # While the MergeRequest is locked, it should present itself as 'merge ongoing'. # The unlocking process is handled by StuckMergeJobsWorker scheduled in Cron. - locked? || !!merge_jid && !merged? && Gitlab::SidekiqStatus.running?(merge_jid) + return true if locked? + + !!merge_jid && !merged? && Gitlab::SidekiqStatus.running?(merge_jid) end def closed_without_fork? |