Commit c4124fce authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Move locked check to a guard-clause

parent 7e60c764
...@@ -398,7 +398,9 @@ class MergeRequest < ActiveRecord::Base ...@@ -398,7 +398,9 @@ class MergeRequest < ActiveRecord::Base
def merge_ongoing? def merge_ongoing?
# While the MergeRequest is locked, it should present itself as 'merge ongoing'. # While the MergeRequest is locked, it should present itself as 'merge ongoing'.
# The unlocking process is handled by StuckMergeJobsWorker scheduled in Cron. # 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 end
def closed_without_fork? def closed_without_fork?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment