Defect #6346 » 6346-new.diff
| lib/redmine/scm/adapters/git_adapter.rb 金 9月 17 09:00:48 2010 +0900 → lib/redmine/scm/adapters/git_adapter.rb 土 9月 18 00:22:16 2010 +0900 | ||
|---|---|---|
|
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|
|
||
| ... | ... | |
|
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,
|
||
| test/unit/repository_git_test.rb 金 9月 17 09:00:48 2010 +0900 → test/unit/repository_git_test.rb 土 9月 18 00:22:16 2010 +0900 | ||
|---|---|---|
|
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
|
||