]> source.dussan.org Git - redmine.git/commitdiff
Tells git to output dates in ISO format.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 8 Nov 2008 15:50:51 +0000 (15:50 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 8 Nov 2008 15:50:51 +0000 (15:50 +0000)
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

index 30d6240017abbb1af71f876cd85fee38b5b08136..a84d3d97f7d6be244e423c19447770837942f96b 100644 (file)
@@ -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