diff options
author | Vinnie Okada <vokada@mrvinn.com> | 2014-09-29 22:50:00 -0500 |
---|---|---|
committer | Vinnie Okada <vokada@mrvinn.com> | 2014-09-29 22:58:21 -0500 |
commit | 31abf76840c5cb8f0713180e3ec39bd06428de1b (patch) | |
tree | 2ee1e50d9397da0347cc77bbddd4e7bc5743be0b /app | |
parent | efcac2befc8d890c61dec434e238520ab401fa46 (diff) | |
download | gitlab-ce-31abf76840c5cb8f0713180e3ec39bd06428de1b.tar.gz |
Replace Gitlab::Git::GitStats
The `GitStats` class has been removed from gitlab_git, so parse commits
directly in `Repository#graph_log`.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/repository.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index ed220ae2e8d..1817de8addb 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -137,8 +137,18 @@ class Repository def graph_log Rails.cache.fetch(cache_key(:graph_log)) do - stats = Gitlab::Git::GitStats.new(raw_repository, root_ref, Gitlab.config.git.timeout) - stats.parsed_log + commits = raw_repository.log(limit: 6000, skip_merges: true, + ref: root_ref) + commits.map do |rugged_commit| + commit = Gitlab::Git::Commit.new(rugged_commit) + + { + author_name: commit.author_name.force_encoding('UTF-8'), + author_email: commit.author_email.force_encoding('UTF-8'), + additions: commit.stats.additions, + deletions: commit.stats.deletions + } + end end end |