Commit 9352bb52 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

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
parent 47475acd
...@@ -23,16 +23,16 @@ module Redmine ...@@ -23,16 +23,16 @@ module Redmine
class GitAdapter < AbstractAdapter class GitAdapter < AbstractAdapter
# Git executable name # Git executable name
GIT_BIN = "git" GIT_BIN = "D:\\dev\\git\\bin\\git.exe"
# Get the revision of a particuliar file # Get the revision of a particuliar file
def get_rev (rev,path) def get_rev (rev,path)
if rev != 'latest' && !rev.nil? 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 else
branch = shellout("#{GIT_BIN} --git-dir #{target('')} branch") { |io| io.grep(/\*/)[0].strip.match(/\* (.*)/)[1] } 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 end
rev=[] rev=[]
i=0 i=0
...@@ -138,7 +138,7 @@ module Redmine ...@@ -138,7 +138,7 @@ module Redmine
def revisions(path, identifier_from, identifier_to, options={}) def revisions(path, identifier_from, identifier_to, options={})
revisions = Revisions.new 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 << " --reverse" if options[:reverse]
cmd << " -n #{options[:limit].to_i} " if (!options.nil?) && options[:limit] cmd << " -n #{options[:limit].to_i} " if (!options.nil?) && options[:limit]
cmd << " #{shell_quote(identifier_from + '..')} " if identifier_from cmd << " #{shell_quote(identifier_from + '..')} " if identifier_from
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment