]> source.dussan.org Git - redmine.git/commitdiff
use a normal unless-statement over a modifier clause in a multiline statement at...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 9 Jul 2020 15:18:47 +0000 (15:18 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 9 Jul 2020 15:18:47 +0000 (15:18 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19875 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/bazaar.rb

index e09aa942d2c375d1c090afa3e09b5af8d1ac34ae..6377139c9bd45f50d841fc4264ce107100f183e2 100644 (file)
@@ -100,23 +100,25 @@ class Repository::Bazaar < Repository
           # loads changesets by batches of 200
           identifier_to = [identifier_from + 199, scm_revision].min
           revisions = scm.revisions('', identifier_to, identifier_from)
-          transaction do
-            revisions.reverse_each do |revision|
-              changeset = Changeset.create(:repository   => self,
-                                           :revision     => revision.identifier,
-                                           :committer    => revision.author,
-                                           :committed_on => revision.time,
-                                           :scmid        => revision.scmid,
-                                           :comments     => revision.message)
+          unless revisions.nil?
+            transaction do
+              revisions.reverse_each do |revision|
+                changeset = Changeset.create(:repository   => self,
+                                             :revision     => revision.identifier,
+                                             :committer    => revision.author,
+                                             :committed_on => revision.time,
+                                             :scmid        => revision.scmid,
+                                             :comments     => revision.message)
 
-              revision.paths.each do |change|
-                Change.create(:changeset => changeset,
-                              :action    => change[:action],
-                              :path      => change[:path],
-                              :revision  => change[:revision])
+                revision.paths.each do |change|
+                  Change.create(:changeset => changeset,
+                                :action    => change[:action],
+                                :path      => change[:path],
+                                :revision  => change[:revision])
+                end
               end
             end
-          end unless revisions.nil?
+          end
           identifier_from = identifier_to + 1
         end
       end