diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-03-08 03:29:11 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-03-08 03:29:11 +0000 |
commit | a1364ed2b8474bed9c2eed37e8ee179b583ddfb2 (patch) | |
tree | 9b8a8531b997fb6c3a5d0043bddf152441195280 /lib | |
parent | daac76f1b642f2b6364812e73d272ebc39bb80ab (diff) | |
download | redmine-a1364ed2b8474bed9c2eed37e8ee179b583ddfb2.tar.gz redmine-a1364ed2b8474bed9c2eed37e8ee179b583ddfb2.zip |
scm: git: code clean up adapter.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5034 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/scm/adapters/git_adapter.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb index 6d2c34ac8..d8c9f30fd 100644 --- a/lib/redmine/scm/adapters/git_adapter.rb +++ b/lib/redmine/scm/adapters/git_adapter.rb @@ -172,7 +172,6 @@ module Redmine files=[] changeset = {} parsing_descr = 0 #0: not parsing desc or files, 1: parsing desc, 2: parsing files - revno = 1 io.each_line do |line| if line =~ /^commit ([0-9a-f]{40})$/ @@ -195,7 +194,6 @@ module Redmine end changeset = {} files = [] - revno = revno + 1 end changeset[:commit] = $1 elsif (parsing_descr == 0) && line =~ /^(\w+):\s*(.*)$/ @@ -210,16 +208,16 @@ module Redmine parsing_descr = 1 changeset[:description] = "" elsif (parsing_descr == 1 || parsing_descr == 2) \ - && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\t(.+)$/ + && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\t(.+)$/ parsing_descr = 2 - fileaction = $1 - filepath = $2 + fileaction = $1 + filepath = $2 files << {:action => fileaction, :path => filepath} elsif (parsing_descr == 1 || parsing_descr == 2) \ - && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\d+\s+(\S+)\t(.+)$/ + && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\d+\s+(\S+)\t(.+)$/ parsing_descr = 2 - fileaction = $1 - filepath = $3 + fileaction = $1 + filepath = $3 files << {:action => fileaction, :path => filepath} elsif (parsing_descr == 1) && line.chomp.to_s == "" parsing_descr = 2 |