summaryrefslogtreecommitdiffstats
path: root/app/models/repository.rb
diff options
context:
space:
mode:
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2014-08-26 17:32:01 +0000
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2014-08-26 17:32:01 +0000
commit8c945fb7914b50ead0c608d8530dbee496b1e878 (patch)
tree19086e94131e0b0d9237534caefe6bcb21624c51 /app/models/repository.rb
parentfc99c1851f697cb92447ce28617a8eb84876f4e9 (diff)
downloadredmine-8c945fb7914b50ead0c608d8530dbee496b1e878.tar.gz
redmine-8c945fb7914b50ead0c608d8530dbee496b1e878.zip
Honnor committers/users mapping in repository statistics (#13487).
git-svn-id: http://svn.redmine.org/redmine/trunk@13353 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 3e5174d2a..55cdb6d88 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -421,9 +421,10 @@ class Repository < ActiveRecord::Base
h = changes_by_author.inject({}) {|o, i| o[i.first] = i.last; o}
commits_by_author.inject({}) do |hash, (name, commits_count)|
- hash[name] = {}
- hash[name][:commits_count] = commits_count
- hash[name][:changes_count] = h[name] || 0
+ mapped_name = (find_committer_user(name) || name).to_s
+ hash[mapped_name] ||= { :commits_count => 0, :changes_count => 0 }
+ hash[mapped_name][:commits_count] += commits_count
+ hash[mapped_name][:changes_count] += h[name] || 0
hash
end
end