summaryrefslogtreecommitdiff
path: root/lib/gitlab/git/blame.rb
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-05-08 15:13:43 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-05-08 17:18:31 +0200
commit4f15460d2c0c42aa3cd06373c19a966f9d29ade3 (patch)
tree681f07915f04e908590f4591ddf753035f584017 /lib/gitlab/git/blame.rb
parentc8bfb3e418b0dcce8b3f3bec91bb2ae64f0fe19d (diff)
downloadgitlab-ce-4f15460d2c0c42aa3cd06373c19a966f9d29ade3.tar.gz
Remove rugged call in blame controller
Fetching commits through #lookup uses rugged, and this is phased out. Also adds a short circuit in the `feature_enabled?` Gitaly method to allow Gitaly to be used when objects are set up with `let` before an example is run.
Diffstat (limited to 'lib/gitlab/git/blame.rb')
-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