Patch #37614 » 0005-Use-the-safe-navigation-operator-instead-of-checking.patch
| app/models/repository/git.rb | ||
|---|---|---|
|
end
|
||
|
def report_last_commit
|
||
|
return false if extra_info.nil?
|
||
|
v = extra_info["extra_report_last_commit"]
|
||
|
v = extra_info&.fetch('extra_report_last_commit', nil)
|
||
|
return false if v.nil?
|
||
|
v.to_s != '0'
|
||
| ... | ... | |
|
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
|
||
| ... | ... | |
|
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
|
||