# HG changeset patch
# Parent 66eb709532530a97dcb0be95dd681d0620f6d882
# User Toshi MARUYAMA

diff -r 66eb70953253 lib/redmine/scm/adapters/git_adapter.rb
--- a/lib/redmine/scm/adapters/git_adapter.rb	金  9月 17 09:00:48 2010 +0900
+++ b/lib/redmine/scm/adapters/git_adapter.rb	土  9月 18 00:22:16 2010 +0900
@@ -86,7 +86,7 @@
 
         def lastrev(path,rev)
           return nil if path.nil?
-          cmd = "#{GIT_BIN} --git-dir #{target('')} log --pretty=fuller --no-merges -n 1 "
+          cmd = "#{GIT_BIN} --git-dir #{target('')} log --date=iso --pretty=fuller --no-merges -n 1 "
           cmd << " #{shell_quote rev} " if rev 
           cmd <<  "-- #{path} " unless path.empty?
           shellout(cmd) do |io|
@@ -94,7 +94,8 @@
               id = io.gets.split[1]
               author = io.gets.match('Author:\s+(.*)$')[1]
               2.times { io.gets }
-              time = io.gets.match('CommitDate:\s+(.*)$')[1]
+              strtime = io.gets.match('CommitDate:\s+(.*)$')[1]
+              time = Time.parse(strtime)
 
               Revision.new({
                 :identifier => id,
diff -r 66eb70953253 test/unit/repository_git_test.rb
--- a/test/unit/repository_git_test.rb	金  9月 17 09:00:48 2010 +0900
+++ b/test/unit/repository_git_test.rb	土  9月 18 00:22:16 2010 +0900
@@ -50,6 +50,10 @@
       change = commit.changes.sort_by(&:path).first
       assert_equal "README", change.path
       assert_equal "A", change.action
+
+      last_rev = @repository.scm.lastrev("README","7234cb2750b63f47bff735edc50a1c0a433c2518")
+      assert_equal "2007-12-14 09:22:52".to_time, last_rev.time
+
     end
     
     def test_fetch_changesets_incremental
