mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-01 03:57:15 +00:00
Use the safe navigation operator instead of checking if an object is nil (#37614).
Patch by Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@21844 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
fa3a42d1de
commit
a1126aebd4
@ -133,11 +133,9 @@ class Repository::Git < Repository
|
||||
scm_brs = branches
|
||||
return if scm_brs.blank?
|
||||
|
||||
h1 = extra_info || {}
|
||||
h = h1.dup
|
||||
h = extra_info&.dup || {}
|
||||
repo_heads = scm_brs.map(&:scmid)
|
||||
h["heads"] ||= []
|
||||
prev_db_heads = h["heads"].dup
|
||||
prev_db_heads = h["heads"]&.dup || []
|
||||
prev_db_heads += heads_from_branches_hash if prev_db_heads.empty?
|
||||
return if prev_db_heads.sort == repo_heads.sort
|
||||
|
||||
@ -232,8 +230,7 @@ class Repository::Git < Repository
|
||||
private :save_revision
|
||||
|
||||
def heads_from_branches_hash
|
||||
h1 = extra_info || {}
|
||||
h = h1.dup
|
||||
h = extra_info&.dup || {}
|
||||
h["branches"] ||= {}
|
||||
h['branches'].map{|br, hs| hs['last_scmid']}
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user