diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2019-04-05 13:51:42 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-04-05 13:51:42 +0300 |
commit | 2fdda74458bb7b58a6a18b72170a572f72afdd95 (patch) | |
tree | 1d593dc1d7ac185ba1d6977865f79d0871b1f846 /app/controllers | |
parent | 934dabaf6da42db7197e07dc95cf88d34e847306 (diff) |
Fall back to project repository type by default
This makes sure that we always have a repository type when trying to
parse a repository from a path.
This is needed because sometimes we want to perform access checks as
if the project already existed, for example when creating a project on
push.
Before this we were only doing that when accessing git over http, this
makes sure it also works correctly when accessing git over SSH
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/git_http_client_controller.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/controllers/projects/git_http_client_controller.rb b/app/controllers/projects/git_http_client_controller.rb index 55d5fce9214..85628dd32d8 100644 --- a/app/controllers/projects/git_http_client_controller.rb +++ b/app/controllers/projects/git_http_client_controller.rb @@ -98,10 +98,8 @@ class Projects::GitHttpClientController < Projects::ApplicationController def repo_type parse_repo_path unless defined?(@repo_type) - # When there a project did not exist, the parsed repo_type would be empty. - # In that case, we want to continue with a regular project repository. As we - # could create the project if the user pushing is allowed to do so. - @repo_type || Gitlab::GlRepository::PROJECT + + @repo_type end def handle_basic_authentication(login, password) |