diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-22 12:09:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-22 12:09:38 +0300 |
commit | c70359a07f62d06825c58e165e08874a21622cdc (patch) | |
tree | fe745e2a9dca388fc63e911f250a29f68e3612ed /app/helpers/gitlab_routing_helper.rb | |
parent | 6c7fe1531266cb807b541992caa62688730027d2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/gitlab_routing_helper.rb')
-rw-r--r-- | app/helpers/gitlab_routing_helper.rb | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/app/helpers/gitlab_routing_helper.rb b/app/helpers/gitlab_routing_helper.rb index 04f34f5a3ae..570278be950 100644 --- a/app/helpers/gitlab_routing_helper.rb +++ b/app/helpers/gitlab_routing_helper.rb @@ -271,7 +271,7 @@ module GitlabRoutingHelper end end - def gitlab_raw_snippet_blob_url(snippet, path, ref = nil) + def gitlab_raw_snippet_blob_url(snippet, path, ref = nil, **options) params = { snippet_id: snippet, ref: ref || snippet.repository.root_ref, @@ -279,26 +279,14 @@ module GitlabRoutingHelper } if snippet.is_a?(ProjectSnippet) - project_snippet_blob_raw_url(snippet.project, params) + project_snippet_blob_raw_url(snippet.project, **params, **options) else - snippet_blob_raw_url(params) + snippet_blob_raw_url(**params, **options) end end - def gitlab_raw_snippet_blob_path(blob, ref = nil) - snippet = blob.container - - params = { - snippet_id: snippet, - ref: ref || blob.repository.root_ref, - path: blob.path - } - - if snippet.is_a?(ProjectSnippet) - project_snippet_blob_raw_path(snippet.project, params) - else - snippet_blob_raw_path(params) - end + def gitlab_raw_snippet_blob_path(snippet, path, ref = nil, **options) + gitlab_raw_snippet_blob_url(snippet, path, ref, only_path: true, **options) end def gitlab_snippet_notes_path(snippet, *args) |