Commit 8167dc61 authored by Alejandro Rodríguez's avatar Alejandro Rodríguez

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

parent 56aa7f5a
......@@ -472,9 +472,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
......
......@@ -1082,6 +1082,16 @@ module Gitlab
@has_visible_content = has_local_branches?
end
def fetch(remote = 'origin')
args = %W(#{Gitlab.config.git.bin_path} fetch #{remote})
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