summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-06-07 13:04:35 +0000
committerGo MAEDA <maeda@farend.jp>2023-06-07 13:04:35 +0000
commitfa9b911f0a01afbec72e2f945020d16bc1f756a7 (patch)
tree909d1713af875848096e1a6d0c0a9eaae5cfeabb /app
parentf41afc7e72657a06a584fd24f946d97d68528458 (diff)
downloadredmine-fa9b911f0a01afbec72e2f945020d16bc1f756a7.tar.gz
redmine-fa9b911f0a01afbec72e2f945020d16bc1f756a7.zip
Fix RuboCop offense Lint/RedundantSafeNavigation (#36919).
git-svn-id: https://svn.redmine.org/redmine/trunk@22253 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/repository/git.rb6
1 files changed, 3 insertions, 3 deletions
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