summaryrefslogtreecommitdiff
path: root/lib/api/internal.rb
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-02-02 15:27:30 +0000
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-02-06 16:52:29 +0000
commit1e56b3f476f9779ec747534e94156a6b8076209c (patch)
treee9374a520232a2d96ef55bf3089dd5350db0a900 /lib/api/internal.rb
parent839829a7786dd163eccb470bf251211bfb90bd72 (diff)
downloadgitlab-ce-1e56b3f476f9779ec747534e94156a6b8076209c.tar.gz
Moves project creationg to git access check for git push
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r--lib/api/internal.rb15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index ed6d022df97..9285fb90cdc 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -42,23 +42,18 @@ module API
end
access_checker_klass = wiki? ? Gitlab::GitAccessWiki : Gitlab::GitAccess
- access_checker = access_checker_klass
- .new(actor, project, protocol, authentication_abilities: ssh_authentication_abilities, redirected_path: redirected_path, target_namespace: project_namespace)
+ access_checker = access_checker_klass.new(actor, project,
+ protocol, authentication_abilities: ssh_authentication_abilities,
+ namespace_path: namespace_path, project_path: project_path,
+ redirected_path: redirected_path)
begin
access_checker.check(params[:action], params[:changes])
+ @project ||= access_checker.project
rescue Gitlab::GitAccess::UnauthorizedError, Gitlab::GitAccess::NotFoundError => e
return { status: false, message: e.message }
end
- if receive_pack? && project.blank?
- begin
- @project = ::Projects::CreateFromPushService.new(user, project_match[:project_path], project_namespace, protocol).execute
- rescue Gitlab::GitAccess::ProjectCreationError => e
- return { status: false, message: e.message }
- end
- end
-
log_user_activity(actor)
{