summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-31 10:15:37 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-31 10:15:37 +0000
commit85749486173662e351c3b03c2bc688d869617b16 (patch)
treeaf2febbb4df52df75336f8bac93a67ebf47ade5a /app
parent7c56ed600411750c5de8138495fb81405c66c194 (diff)
downloadredmine-85749486173662e351c3b03c2bc688d869617b16.tar.gz
redmine-85749486173662e351c3b03c2bc688d869617b16.zip
code format clean up Repository::Git model
git-svn-id: http://svn.redmine.org/redmine/trunk@12742 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/repository/git.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb
index ea3607b9d..89e740d87 100644
--- a/app/models/repository/git.rb
+++ b/app/models/repository/git.rb
@@ -180,10 +180,13 @@ class Repository::Git < Repository
# So, Redmine needs to scan revisions and database every time.
#
# This is replacing the one-after-one queries.
- # Find all revisions, that are in the database, and then remove them from the revision array.
+ # Find all revisions, that are in the database, and then remove them
+ # from the revision array.
# Then later we won't need any conditions for db existence.
- # Query for several revisions at once, and remove them from the revisions array, if they are there.
- # Do this in chunks, to avoid eventual memory problems (in case of tens of thousands of commits).
+ # Query for several revisions at once, and remove them
+ # from the revisions array, if they are there.
+ # Do this in chunks, to avoid eventual memory problems
+ # (in case of tens of thousands of commits).
# If there are no revisions (because the original code's algorithm filtered them),
# then this part will be stepped over.
# We make queries, just if there is any revision.
@@ -198,7 +201,6 @@ class Repository::Git < Repository
revisions.reject!{|r| recent_revisions.include?(r.scmid)}
offset += limit
end
-
revisions.each do |rev|
transaction do
# There is no search in the db for this revision, because above we ensured,
@@ -240,7 +242,6 @@ class Repository::Git < Repository
def latest_changesets(path,rev,limit=10)
revisions = scm.revisions(path, nil, rev, :limit => limit, :all => false)
return [] if revisions.nil? || revisions.empty?
-
changesets.where(:scmid => revisions.map {|c| c.scmid}).all
end