Clean hierarchy of calls between models and Gitalb::Git for blob search
This commit is contained in:
parent
f72598b659
commit
9cc15172de
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue