Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-01 12:30:43 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-01 12:30:43 +0300
commit2d85458ac7e5c054b93cf5f3bf228dfcf12fe0a9 (patch)
treef69594cffa3bca318878cdc6ace0bf2fec5795aa /app/models
parentb096374dd50226b96f96203f3a02780c40c4502a (diff)
parentbaf12f45d8705693755a8343e53525e92dc26ca6 (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.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)