diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-07-01 12:30:43 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-07-01 12:30:43 +0300 |
commit | 2d85458ac7e5c054b93cf5f3bf228dfcf12fe0a9 (patch) | |
tree | f69594cffa3bca318878cdc6ace0bf2fec5795aa /app/models | |
parent | b096374dd50226b96f96203f3a02780c40c4502a (diff) | |
parent | baf12f45d8705693755a8343e53525e92dc26ca6 (diff) |
Merge branch 'fix-zero-sha-lookup' into 'master'
Repository#blob_at should return nil for 00000000... sha
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
See merge request !916
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/repository.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index b32e8847bb5..cab3e896159 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -8,7 +8,7 @@ class Repository @project = project if path_with_namespace - @raw_repository = Gitlab::Git::Repository.new(path_to_repo) + @raw_repository = Gitlab::Git::Repository.new(path_to_repo) @raw_repository.autocrlf = :input end @@ -173,7 +173,9 @@ class Repository end def blob_at(sha, path) - Gitlab::Git::Blob.find(self, sha, path) + unless Gitlab::Git.blank_ref?(sha) + Gitlab::Git::Blob.find(self, sha, path) + end end def blob_by_oid(oid) |