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:
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 06c9eb3bd70..bd5dd7e8f74 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -41,11 +41,7 @@ class Repository
return @exists unless @exists.nil?
@exists = cache.fetch(:exists?) do
- begin
- raw_repository && raw_repository.rugged ? true : false
- rescue Gitlab::Git::Repository::NoRepository
- false
- end
+ refs_directory_exists?
end
end
@@ -1148,6 +1144,12 @@ class Repository
private
+ def refs_directory_exists?
+ return false unless path_with_namespace
+
+ File.exist?(File.join(path_to_repo, 'refs'))
+ end
+
def cache
@cache ||= RepositoryCache.new(path_with_namespace, @project.id)
end