From 9352bb527b0ad4089336bb18814820e734f63ff7 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 8 Nov 2008 15:50:51 +0000 Subject: [PATCH] Tells git to output dates in ISO format. Fixes: Git Adapter date parsing ignores timezone (#2149). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1995 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/scm/adapters/git_adapter.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb index 30d624001..a84d3d97f 100644 --- a/lib/redmine/scm/adapters/git_adapter.rb +++ b/lib/redmine/scm/adapters/git_adapter.rb @@ -23,16 +23,16 @@ module Redmine class GitAdapter < AbstractAdapter # Git executable name - GIT_BIN = "git" + GIT_BIN = "D:\\dev\\git\\bin\\git.exe" # Get the revision of a particuliar file def get_rev (rev,path) if rev != 'latest' && !rev.nil? - cmd="#{GIT_BIN} --git-dir #{target('')} show #{shell_quote rev} -- #{shell_quote path}" + cmd="#{GIT_BIN} --git-dir #{target('')} show --date=iso #{shell_quote rev} -- #{shell_quote path}" else branch = shellout("#{GIT_BIN} --git-dir #{target('')} branch") { |io| io.grep(/\*/)[0].strip.match(/\* (.*)/)[1] } - cmd="#{GIT_BIN} --git-dir #{target('')} log -1 #{branch} -- #{shell_quote path}" + cmd="#{GIT_BIN} --git-dir #{target('')} log --date=iso -1 #{branch} -- #{shell_quote path}" end rev=[] i=0 @@ -138,7 +138,7 @@ module Redmine def revisions(path, identifier_from, identifier_to, options={}) revisions = Revisions.new - cmd = "#{GIT_BIN} --git-dir #{target('')} log --raw " + cmd = "#{GIT_BIN} --git-dir #{target('')} log --raw --date=iso" cmd << " --reverse" if options[:reverse] cmd << " -n #{options[:limit].to_i} " if (!options.nil?) && options[:limit] cmd << " #{shell_quote(identifier_from + '..')} " if identifier_from