diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-24 03:07:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-24 03:07:14 +0300 |
commit | c4e4f0d16733caba766d9c1ae3b4b9a3f0bfb0ca (patch) | |
tree | 6008465efc7b0ef017dd04afeddcfd23ee84999c /app/presenters | |
parent | 08a284ca5e259f685b32ae255e42c7307891aed1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/blob_presenter.rb | 29 | ||||
-rw-r--r-- | app/presenters/ci/build_runner_presenter.rb | 3 |
2 files changed, 7 insertions, 25 deletions
diff --git a/app/presenters/blob_presenter.rb b/app/presenters/blob_presenter.rb index 2ee19e3b527..f25436c54be 100644 --- a/app/presenters/blob_presenter.rb +++ b/app/presenters/blob_presenter.rb @@ -56,23 +56,23 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated end def web_url - url_helpers.project_blob_url(*path_params) + url_helpers.project_blob_url(project, ref_qualified_path) end def web_path - url_helpers.project_blob_path(*path_params) + url_helpers.project_blob_path(project, ref_qualified_path) end def edit_blob_path - url_helpers.project_edit_blob_path(*path_params) + url_helpers.project_edit_blob_path(project, ref_qualified_path) end def raw_path - url_helpers.project_raw_path(*path_params) + url_helpers.project_raw_path(project, ref_qualified_path) end def replace_path - url_helpers.project_update_blob_path(*path_params) + url_helpers.project_update_blob_path(project, ref_qualified_path) end def pipeline_editor_path @@ -164,18 +164,6 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated private - def path_params - if Feature.enabled?(:use_ref_type_parameter, project) && ref_type - [project, ref_qualified_path, { ref_type: ref_type }] - else - [project, ref_qualified_path] - end - end - - def ref_type - blob.try(:ref_type) - end - def url_helpers Gitlab::Routing.url_helpers end @@ -191,12 +179,7 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated end def ref_qualified_path - commit_id = blob.commit_id - - # A hack to make the commit_id response from gitaly something controllers can handle - commit_id = commit_id.sub(%r{^refs/(heads|tags)/}, '') if ref_type && Feature.enabled?(:use_ref_type_parameter, project) - - File.join(commit_id, blob.path) + File.join(blob.commit_id, blob.path) end def load_all_blob_data diff --git a/app/presenters/ci/build_runner_presenter.rb b/app/presenters/ci/build_runner_presenter.rb index 7242a80b924..ff9522e2db0 100644 --- a/app/presenters/ci/build_runner_presenter.rb +++ b/app/presenters/ci/build_runner_presenter.rb @@ -38,8 +38,7 @@ module Ci variables .sort_and_expand_all(keep_undefined: true, expand_file_refs: false, - expand_raw_refs: !stop_expanding_raw_refs, - project: project) + expand_raw_refs: !stop_expanding_raw_refs) .to_runner_variables end |