1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-01 03:57:15 +00:00

Fix RuboCop offense Lint/RedundantSafeNavigation (#36919).

git-svn-id: https://svn.redmine.org/redmine/trunk@22253 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2023-06-07 13:04:35 +00:00
parent f41afc7e72
commit fa9b911f0a

View File

@ -133,9 +133,9 @@ class Repository::Git < Repository
scm_brs = branches
return if scm_brs.blank?
h = extra_info&.dup || {}
h = extra_info.dup || {}
repo_heads = scm_brs.map(&:scmid)
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
@ -230,7 +230,7 @@ class Repository::Git < Repository
private :save_revision
def heads_from_branches_hash
h = extra_info&.dup || {}
h = extra_info.dup || {}
h["branches"] ||= {}
h['branches'].map{|br, hs| hs['last_scmid']}
end