Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-28 21:08:35 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-28 21:08:35 +0300
commit6315ed9630fb1c6ade3114beb762cd1568d79219 (patch)
tree2a5d31936d09c14420c8f4c8bd752e268f0eb19f /lib/gitlab/git_access.rb
parentfedf978f9aa1909ed7bb3fad767ad120a1c6bd7b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/git_access.rb')
-rw-r--r--lib/gitlab/git_access.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb
index 7e9ec097ef7..906350e57c5 100644
--- a/lib/gitlab/git_access.rb
+++ b/lib/gitlab/git_access.rb
@@ -50,8 +50,8 @@ module Gitlab
@project = project
@protocol = protocol
@authentication_abilities = authentication_abilities
- @namespace_path = namespace_path
- @project_path = project_path
+ @namespace_path = namespace_path || project&.namespace&.full_path
+ @project_path = project_path || project&.path
@redirected_path = redirected_path
@auth_result_type = auth_result_type
end
@@ -60,6 +60,7 @@ module Gitlab
@logger = Checks::TimedLogger.new(timeout: INTERNAL_TIMEOUT, header: LOG_HEADER)
@changes = changes
+ check_namespace!
check_protocol!
check_valid_actor!
check_active_user!
@@ -136,6 +137,12 @@ module Gitlab
end
end
+ def check_namespace!
+ return if namespace_path.present?
+
+ raise NotFoundError, ERROR_MESSAGES[:project_not_found]
+ end
+
def check_active_user!
return unless user