diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /lib/gitlab/url_builder.rb | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'lib/gitlab/url_builder.rb')
-rw-r--r-- | lib/gitlab/url_builder.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/gitlab/url_builder.rb b/lib/gitlab/url_builder.rb index cd15130cee6..1e522ae63b6 100644 --- a/lib/gitlab/url_builder.rb +++ b/lib/gitlab/url_builder.rb @@ -71,7 +71,11 @@ module Gitlab end def snippet_url(snippet, **options) - if options.delete(:raw).present? + if options[:file].present? + file, ref = options.values_at(:file, :ref) + + instance.gitlab_raw_snippet_blob_url(snippet, file, ref) + elsif options.delete(:raw).present? instance.gitlab_raw_snippet_url(snippet, **options) else instance.gitlab_snippet_url(snippet, **options) @@ -81,9 +85,11 @@ module Gitlab def wiki_url(wiki, **options) return wiki_page_url(wiki, Wiki::HOMEPAGE, **options) unless options[:action] - options[:controller] = 'projects/wikis' - options[:namespace_id] = wiki.container.namespace - options[:project_id] = wiki.container + if wiki.container.is_a?(Project) + options[:controller] = 'projects/wikis' + options[:namespace_id] = wiki.container.namespace + options[:project_id] = wiki.container + end instance.url_for(**options) end |