Move locked check to a guard-clause
This commit is contained in:
parent
7e60c76428
commit
c4124fce48
1 changed files with 3 additions and 1 deletions
|
@ -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?
|
||||||
|
|
Loading…
Reference in a new issue