From fa9b911f0a01afbec72e2f945020d16bc1f756a7 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Wed, 7 Jun 2023 13:04:35 +0000 Subject: Fix RuboCop offense Lint/RedundantSafeNavigation (#36919). git-svn-id: https://svn.redmine.org/redmine/trunk@22253 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/repository/git.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb index 2c77c173d..d67540f8b 100644 --- a/app/models/repository/git.rb +++ b/app/models/repository/git.rb @@ -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 -- cgit v1.2.3