Actions
Defect #5612
closedgit repository reporting the wrong age
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
2010-05-28
Due date:
% Done:
100%
Estimated time:
Resolution:
Duplicate
Affected version:
Description
Here is a patch to fix a problem where browsing a git repository reports the wrong age.
*** lib/redmine/scm/adapters/git_adapter.rb.orig Sun Feb 7 04:55:35 2010
--- lib/redmine/scm/adapters/git_adapter.rb Mon Mar 1 18:18:27 2010
***************
*** 85,91 ****
def lastrev(path,rev)
return nil if path.nil?
! cmd = "#{GIT_BIN} --git-dir #{target('')} log --pretty=fuller --no-merges -n 1 "
cmd << " #{shell_quote rev} " if rev
cmd << "-- #{path} " unless path.empty?
shellout(cmd) do |io|
--- 85,91 ----
def lastrev(path,rev)
return nil if path.nil?
! 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|
***************
*** 93,99 ****
id = io.gets.split[1]
author = io.gets.match('Author:\s+(.*)$')[1]
2.times { io.gets }
! time = io.gets.match('CommitDate:\s+(.*)$')[1]
Revision.new({
:identifier => id,
--- 93,99 ----
id = io.gets.split[1]
author = io.gets.match('Author:\s+(.*)$')[1]
2.times { io.gets }
! time = Time.parse(io.gets.match('CommitDate:\s+(.*)$')[1])
Revision.new({
:identifier => id,
Actions