Project

General

Profile

Patch #37614 » 0003-Fix-RuboCop-offense-Style-IfUnlessModifier.patch

Go MAEDA, 2022-08-28 07:15

View differences:

app/models/repository/git.rb
27 27

  
28 28
  def self.human_attribute_name(attribute_key_name, *args)
29 29
    attr_name = attribute_key_name.to_s
30
    if attr_name == "url"
31
      attr_name = "path_to_repository"
32
    end
30
    attr_name = 'path_to_repository' if attr_name == 'url'
33 31
    super(attr_name, *args)
34 32
  end
35 33

  
......
140 138
    repo_heads = scm_brs.map(&:scmid)
141 139
    h["heads"] ||= []
142 140
    prev_db_heads = h["heads"].dup
143
    if prev_db_heads.empty?
144
      prev_db_heads += heads_from_branches_hash
145
    end
141
    prev_db_heads += heads_from_branches_hash if prev_db_heads.empty?
146 142
    return if prev_db_heads.sort == repo_heads.sort
147 143

  
148 144
    h["db_consistent"]  ||= {}
......
230 226
        :comments     => rev.message,
231 227
        :parents      => parents
232 228
      )
233
    unless changeset.new_record?
234
      rev.paths.each {|change| changeset.create_change(change)}
235
    end
229
    rev.paths.each {|change| changeset.create_change(change)} unless changeset.new_record?
236 230
    changeset
237 231
  end
238 232
  private :save_revision
(3-3/6)