diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 18:38:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 18:38:24 +0000 |
commit | 983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch) | |
tree | b153cd387c14ba23bd5a07514c7c01fddf6a78a0 /lib/api/helpers/internal_helpers.rb | |
parent | a2bddee2cdb38673df0e004d5b32d9f77797de64 (diff) | |
download | gitlab-ce-983a0bba5d2a042c4a3bbb22432ec192c7501d82.tar.gz |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'lib/api/helpers/internal_helpers.rb')
-rw-r--r-- | lib/api/helpers/internal_helpers.rb | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/api/helpers/internal_helpers.rb b/lib/api/helpers/internal_helpers.rb index f7aabc8ce4f..31272c537a3 100644 --- a/lib/api/helpers/internal_helpers.rb +++ b/lib/api/helpers/internal_helpers.rb @@ -3,7 +3,7 @@ module API module Helpers module InternalHelpers - attr_reader :redirected_path, :container + attr_reader :redirected_path delegate :wiki?, to: :repo_type @@ -11,15 +11,22 @@ module API @actor ||= Support::GitAccessActor.from_params(params) end + # rubocop:disable Gitlab/ModuleWithInstanceVariables def repo_type - set_project unless defined?(@repo_type) # rubocop:disable Gitlab/ModuleWithInstanceVariables - @repo_type # rubocop:disable Gitlab/ModuleWithInstanceVariables + parse_repo_path unless defined?(@repo_type) + @repo_type end def project - set_project unless defined?(@project) # rubocop:disable Gitlab/ModuleWithInstanceVariables - @project # rubocop:disable Gitlab/ModuleWithInstanceVariables + parse_repo_path unless defined?(@project) + @project + end + + def container + parse_repo_path unless defined?(@container) + @container end + # rubocop:enable Gitlab/ModuleWithInstanceVariables def access_checker_for(actor, protocol) access_checker_klass.new(actor.key_or_user, container, protocol, @@ -79,7 +86,7 @@ module API end # rubocop:disable Gitlab/ModuleWithInstanceVariables - def set_project + def parse_repo_path @container, @project, @repo_type, @redirected_path = if params[:gl_repository] Gitlab::GlRepository.parse(params[:gl_repository]) |