]> source.dussan.org Git - redmine.git/commitdiff
cleanup: rubocop: fix Style/MultilineIfModifier in app/models/repository/subversion.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 23 Nov 2019 15:11:40 +0000 (15:11 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 23 Nov 2019 15:11:40 +0000 (15:11 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19215 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
app/models/repository/subversion.rb

index af6042e3dab872b3dbad419e2ff54c92fc36daac..a04b91d2bd83511fbfa1ed109d365a5bb52b8895 100644 (file)
@@ -1246,7 +1246,6 @@ Style/MultilineIfModifier:
     - 'app/models/issue_query.rb'
     - 'app/models/query.rb'
     - 'app/models/repository/bazaar.rb'
-    - 'app/models/repository/subversion.rb'
     - 'app/models/time_entry_query.rb'
     - 'app/views/common/feed.atom.builder'
     - 'lib/redmine/access_keys.rb'
index f6e37fbd657f39adc66c45757be99d18fc6e7619..c42ffd4959eb01344238a6e22b94f34336cd429f 100644 (file)
@@ -68,19 +68,22 @@ class Repository::Subversion < Repository
           # loads changesets by batches of 200
           identifier_to = [identifier_from + 199, scm_revision].min
           revisions = scm.revisions('', identifier_to, identifier_from, :with_paths => true)
-          revisions.reverse_each do |revision|
-            transaction do
-              changeset = Changeset.create(:repository   => self,
-                                           :revision     => revision.identifier,
-                                           :committer    => revision.author,
-                                           :committed_on => revision.time,
-                                           :comments     => revision.message)
-
-              revision.paths.each do |change|
-                changeset.create_change(change)
-              end unless changeset.new_record?
+          unless revisions.nil?
+            revisions.reverse_each do |revision|
+              transaction do
+                changeset = Changeset.create(:repository   => self,
+                                             :revision     => revision.identifier,
+                                             :committer    => revision.author,
+                                             :committed_on => revision.time,
+                                             :comments     => revision.message)
+                unless changeset.new_record?
+                  revision.paths.each do |change|
+                    changeset.create_change(change)
+                  end
+                end
+              end
             end
-          end unless revisions.nil?
+          end
           identifier_from = identifier_to + 1
         end
       end