mirror of
https://github.com/redmine/redmine.git
synced 2026-03-05 03:51:38 +01:00
Performance optimization: support limit for call to revisions
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1210 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -96,7 +96,7 @@ module Redmine
|
||||
def info
|
||||
root_url = target('')
|
||||
info = Info.new({:root_url => target(''),
|
||||
:lastrev => revisions(root_url,nil,nil,nil).first
|
||||
:lastrev => revisions(root_url,nil,nil,{:limit => 1}).first
|
||||
})
|
||||
info
|
||||
rescue Errno::ENOENT => e
|
||||
@@ -141,6 +141,7 @@ module Redmine
|
||||
def revisions(path, identifier_from, identifier_to, options={})
|
||||
revisions = Revisions.new
|
||||
cmd = "cd #{target('')} && #{GIT_BIN} log --raw "
|
||||
cmd << " -n #{options[:limit].to_i}" if (!options.nil?) && options[:limit]
|
||||
cmd << " #{identifier_from}.. " if identifier_from
|
||||
cmd << " #{identifier_to} " if identifier_to
|
||||
#cmd << " HEAD " if !identifier_to
|
||||
|
||||
Reference in New Issue
Block a user