summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-10-06 20:47:06 -0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-10-12 22:03:09 -0300
commit9cc15172deaa4582c5fd956cc163539041d018b1 (patch)
tree16bb6e915c3cc96171b637c942eac5a839ffe346 /lib
parentf72598b659871a3d4e8ef1905918067522ba2a29 (diff)
downloadgitlab-ce-9cc15172deaa4582c5fd956cc163539041d018b1.tar.gz
Clean hierarchy of calls between models and Gitalb::Git for blob search
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/git/repository.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index a6b2d189f18..b705c92d686 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -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