diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-02-07 09:21:17 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-02-07 09:21:17 +0100 |
commit | 2cce501f452e84d9fe8c27bd0291e4984c12bc4c (patch) | |
tree | 5b98215be26330c0db4b39e2f5f39720f0c63f2c /lib/api/helpers | |
parent | adb6dd067037a3df1951b5dacae37a06541ec286 (diff) | |
parent | 4457cf9d178dc9912fd9c16427ad81b389179d00 (diff) | |
download | gitlab-ce-2cce501f452e84d9fe8c27bd0291e4984c12bc4c.tar.gz |
Merge commit '4457cf9d178dc9912fd9c16427ad81b389179d00' into fix/gb/fix-redundant-pipeline-stagesfix/gb/fix-redundant-pipeline-stages
* commit '4457cf9d178dc9912fd9c16427ad81b389179d00': (76 commits)
Conflicts:
spec/services/ci/retry_build_service_spec.rb
Diffstat (limited to 'lib/api/helpers')
-rw-r--r-- | lib/api/helpers/internal_helpers.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/api/helpers/internal_helpers.rb b/lib/api/helpers/internal_helpers.rb index eb67de81a0d..cd59da6fc70 100644 --- a/lib/api/helpers/internal_helpers.rb +++ b/lib/api/helpers/internal_helpers.rb @@ -60,8 +60,20 @@ module API false end + def project_path + project&.path || project_path_match[:project_path] + end + + def namespace_path + project&.namespace&.full_path || project_path_match[:namespace_path] + end + private + def project_path_match + @project_path_match ||= params[:project].match(Gitlab::PathRegex.full_project_git_path_regex) || {} + end + # rubocop:disable Gitlab/ModuleWithInstanceVariables def set_project if params[:gl_repository] |