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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-06 18:08:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-06 18:08:05 +0300
commitf78257cbddd711e18cbce93ad740a4aa0acac347 (patch)
tree7f018abe3ce1c0010879cc480f348a35e616fabb /app/models/snippet.rb
parentf500600a43b531e2e7a5858b74bd35312b02c349 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r--app/models/snippet.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index 770d9b5205c..27e1778e9b6 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -197,6 +197,8 @@ class Snippet < ApplicationRecord
end
def blobs
+ return [] unless repository_exists?
+
repository.ls_files(repository.root_ref).map { |file| Blob.lazy(self, repository.root_ref, file) }
end