From 5600c3cf5afd54c6e3c9fb1ccd0b1922310577db Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 23 Nov 2019 15:11:40 +0000 Subject: cleanup: rubocop: fix Style/MultilineIfModifier in app/models/repository/subversion.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19215 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/repository/subversion.rb | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'app/models') diff --git a/app/models/repository/subversion.rb b/app/models/repository/subversion.rb index f6e37fbd6..c42ffd495 100644 --- a/app/models/repository/subversion.rb +++ b/app/models/repository/subversion.rb @@ -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 -- cgit v1.2.3