summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-03 21:15:46 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-03 21:15:46 +0000
commit3355ffe029fdecbe78a75f7f459bd93eae835a42 (patch)
tree2aecfc3f717fea61872e677e3c9b6521f4160c36 /lib
parent6817a45e7fe07313ad96a1031367bc134eef8820 (diff)
downloadredmine-3355ffe029fdecbe78a75f7f459bd93eae835a42.tar.gz
redmine-3355ffe029fdecbe78a75f7f459bd93eae835a42.zip
Fixes git annotate (#3832).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3531 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/scm/adapters/git_adapter.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index ae619e032..d15bce1af 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -235,14 +235,15 @@ module Redmine
# git annotates binary files
return nil if content.is_binary_data?
identifier = ''
- author = ''
+ # git shows commit author on the first occurrence only
+ authors_by_commit = {}
content.split("\n").each do |line|
if line =~ /^([0-9a-f]{39,40})\s.*/
identifier = $1
elsif line =~ /^author (.+)/
- author = $1.strip
+ authors_by_commit[identifier] = $1.strip
elsif line =~ /^\t(.*)/
- blame.add_line($1, Revision.new(:identifier => identifier, :author => author))
+ blame.add_line($1, Revision.new(:identifier => identifier, :author => authors_by_commit[identifier]))
identifier = ''
author = ''
end