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.
This commit is contained in:
Zeger-Jan van de Weg 2018-05-08 15:13:43 +02:00
parent c8bfb3e418
commit 4f15460d2c
No known key found for this signature in database
GPG Key ID: 65F6A8D64A88ABAC
1 changed files with 3 additions and 7 deletions

View File

@ -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