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 ...@@ -468,9 +468,7 @@ class Repository
end end
def blob_at(sha, path) def blob_at(sha, path)
unless Gitlab::Git.blank_ref?(sha) Blob.decorate(raw_repository.blob_at(sha, path), project)
Blob.decorate(Gitlab::Git::Blob.find(self, sha, path), project)
end
rescue Gitlab::Git::Repository::NoRepository rescue Gitlab::Git::Repository::NoRepository
nil nil
end end
......
...@@ -1092,6 +1092,10 @@ module Gitlab ...@@ -1092,6 +1092,10 @@ module Gitlab
popen(args, @path).last.zero? popen(args, @path).last.zero?
end end
def blob_at(sha, path)
Gitlab::Git::Blob.find(self, sha, path) unless Gitlab::Git.blank_ref?(sha)
end
def gitaly_repository def gitaly_repository
Gitlab::GitalyClient::Util.repository(@storage, @relative_path, @gl_repository) Gitlab::GitalyClient::Util.repository(@storage, @relative_path, @gl_repository)
end 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