summaryrefslogtreecommitdiff
path: root/app/presenters/snippet_presenter.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
commit9f46488805e86b1bc341ea1620b866016c2ce5ed (patch)
treef9748c7e287041e37d6da49e0a29c9511dc34768 /app/presenters/snippet_presenter.rb
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
downloadgitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/presenters/snippet_presenter.rb')
-rw-r--r--app/presenters/snippet_presenter.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/presenters/snippet_presenter.rb b/app/presenters/snippet_presenter.rb
index ba0b2b42383..faaf7568c72 100644
--- a/app/presenters/snippet_presenter.rb
+++ b/app/presenters/snippet_presenter.rb
@@ -12,11 +12,11 @@ class SnippetPresenter < Gitlab::View::Presenter::Delegated
end
def ssh_url_to_repo
- snippet.ssh_url_to_repo if snippet.versioned_enabled_for?(current_user)
+ snippet.ssh_url_to_repo if snippet.repository_exists?
end
def http_url_to_repo
- snippet.http_url_to_repo if snippet.versioned_enabled_for?(current_user)
+ snippet.http_url_to_repo if snippet.repository_exists?
end
def can_read_snippet?
@@ -36,10 +36,10 @@ class SnippetPresenter < Gitlab::View::Presenter::Delegated
end
def blob
- if Feature.enabled?(:version_snippets, current_user) && !snippet.repository.empty?
- snippet.blobs.first
- else
+ if snippet.empty_repo?
snippet.blob
+ else
+ snippet.blobs.first
end
end