diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-01-03 10:45:00 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-01-03 10:45:00 +0000 |
commit | 7958facadcc30fcce2f9ba27602944e713ce85f6 (patch) | |
tree | 6864b1ecacfeca9fd7bb3a99a9786a799c90db7d /lib/redmine/scm/adapters/git_adapter.rb | |
parent | 8487e0a5b83ff63bd02a8e4a061a587c8a37ce78 (diff) | |
download | redmine-7958facadcc30fcce2f9ba27602944e713ce85f6.tar.gz redmine-7958facadcc30fcce2f9ba27602944e713ce85f6.zip |
repository: git: change io.gets to io.readlines (#5404, #5096).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4624 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/scm/adapters/git_adapter.rb')
-rw-r--r-- | lib/redmine/scm/adapters/git_adapter.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb index cd8fd95d4..302ded580 100644 --- a/lib/redmine/scm/adapters/git_adapter.rb +++ b/lib/redmine/scm/adapters/git_adapter.rb @@ -89,12 +89,13 @@ module Redmine cmd = "#{GIT_BIN} --git-dir #{target('')} log --no-color --date=iso --pretty=fuller --no-merges -n 1 " cmd << " #{shell_quote rev} " if rev cmd << "-- #{shell_quote path} " unless path.empty? - shellout(cmd) do |io| - begin - 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]).localtime + lines = [] + shellout(cmd) { |io| lines = io.readlines } + return nil if $? && $?.exitstatus != 0 + begin + id = lines[0].split[1] + author = lines[1].match('Author:\s+(.*)$')[1] + time = Time.parse(lines[4].match('CommitDate:\s+(.*)$')[1]).localtime Revision.new({ :identifier => id, @@ -104,10 +105,9 @@ module Redmine :message => nil, :paths => nil }) - rescue NoMethodError => e + rescue NoMethodError => e logger.error("The revision '#{path}' has a wrong format") return nil - end end end |