summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-01 11:02:37 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-01 11:02:37 +0200
commitbaf12f45d8705693755a8343e53525e92dc26ca6 (patch)
tree26c11bc6c5ddb5d9837586994838fed2c40dc116 /app/models
parente934a62aeb67bbca565a77f8c5d19ebf1272a1bd (diff)
downloadgitlab-ce-baf12f45d8705693755a8343e53525e92dc26ca6.tar.gz
Repository#blob_at should return nil for 00000000... shafix-zero-sha-lookup
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models')
-rw-r--r--app/models/repository.rb6
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)