Commit 9cc15172 authored by Alejandro Rodríguez's avatar Alejandro Rodríguez

Clean hierarchy of calls between models and Gitalb::Git for blob search

parent f72598b6
......@@ -468,9 +468,7 @@ class Repository
end
def blob_at(sha, path)
unless Gitlab::Git.blank_ref?(sha)
Blob.decorate(Gitlab::Git::Blob.find(self, sha, path), project)
end
Blob.decorate(raw_repository.blob_at(sha, path), project)
rescue Gitlab::Git::Repository::NoRepository
nil
end
......
......@@ -1092,6 +1092,10 @@ module Gitlab
popen(args, @path).last.zero?
end
def blob_at(sha, path)
Gitlab::Git::Blob.find(self, sha, path) unless Gitlab::Git.blank_ref?(sha)
end
def gitaly_repository
Gitlab::GitalyClient::Util.repository(@storage, @relative_path, @gl_repository)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment