summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-20 01:33:50 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-20 01:33:50 +0000
commit329b2aa2630860796196d71404c8d82d2e6e9223 (patch)
tree49a31f9cd0993c5854255ccddc42da04f2cd55f0 /lib
parent1c5cd49cd276eb1c1a2792d5d443da6e3531a69b (diff)
downloadredmine-329b2aa2630860796196d71404c8d82d2e6e9223.tar.gz
redmine-329b2aa2630860796196d71404c8d82d2e6e9223.zip
scm: git: fix wrong commit range in git log command on Windows (#7657).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4887 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/scm/adapters/git_adapter.rb25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index d23fc2240..73b79d5d8 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -145,17 +145,18 @@ module Redmine
def revisions(path, identifier_from, identifier_to, options={})
revisions = Revisions.new
+ cmd_args = %w|log --raw --date=iso --pretty=fuller|
+ cmd_args << "--reverse" if options[:reverse]
+ cmd_args << "--all" if options[:all]
+ cmd_args << "-n" << "#{options[:limit].to_i}" if options[:limit]
+ from_to = ""
+ from_to << "#{identifier_from}.." if identifier_from
+ from_to << "#{identifier_to}" if identifier_to
+ cmd_args << from_to if !from_to.empty?
+ cmd_args << "--since=#{options[:since].strftime("%Y-%m-%d %H:%M:%S")}" if options[:since]
+ cmd_args << "--" << "#{path}" if path && !path.empty?
- cmd = "#{self.class.sq_bin} --git-dir #{target('')} log --no-color --raw --date=iso --pretty=fuller "
- cmd << " --reverse " if options[:reverse]
- cmd << " --all " if options[:all]
- cmd << " -n #{options[:limit].to_i} " if options[:limit]
- cmd << "#{shell_quote(identifier_from + '..')}" if identifier_from
- cmd << "#{shell_quote identifier_to}" if identifier_to
- cmd << " --since=#{shell_quote(options[:since].strftime("%Y-%m-%d %H:%M:%S"))}" if options[:since]
- cmd << " -- #{shell_quote path}" if path && !path.empty?
-
- shellout(cmd) do |io|
+ scm_cmd *cmd_args do |io|
files=[]
changeset = {}
parsing_descr = 0 #0: not parsing desc or files, 1: parsing desc, 2: parsing files
@@ -232,8 +233,8 @@ module Redmine
end
end
end
-
- return nil if $? && $?.exitstatus != 0
+ revisions
+ rescue ScmCommandAborted
revisions
end