summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-05-09 16:07:21 +0000
committerRobert Speicher <robert@gitlab.com>2018-05-09 16:07:21 +0000
commitce793073d7ea9cc6f7d657c1982f4c295d37c411 (patch)
treefe3618286c54fe0f53681e3fff40ea8bf78f7219
parent1802954b4785fa3d6bd3686f5b6de3094a2eb851 (diff)
parent4f15460d2c0c42aa3cd06373c19a966f9d29ade3 (diff)
downloadgitlab-ce-ce793073d7ea9cc6f7d657c1982f4c295d37c411.tar.gz
Merge branch 'zj-remove-rugged-call' into 'master'
Remove rugged call in blame controller See merge request gitlab-org/gitlab-ce!18817
-rw-r--r--lib/gitlab/git/blame.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/gitlab/git/blame.rb b/lib/gitlab/git/blame.rb
index 6d6ed065f79..4158d50cd9e 100644
--- a/lib/gitlab/git/blame.rb
+++ b/lib/gitlab/git/blame.rb
@@ -15,10 +15,7 @@ module Gitlab
def each
@blames.each do |blame|
- yield(
- Gitlab::Git::Commit.new(@repo, blame.commit),
- blame.line
- )
+ yield(blame.commit, blame.line)
end
end
@@ -60,9 +57,8 @@ module Gitlab
end
end
- # load all commits in single call
- commits.keys.each do |key|
- commits[key] = @repo.lookup(key)
+ Gitlab::Git::Commit.batch_by_oid(@repo, commits.keys).each do |commit|
+ commits[commit.sha] = commit
end
# get it together