Commit b7712260 authored by Douwe Maan's avatar Douwe Maan Committed by Jarka Kadlecova

Merge branch 'rs-git-access-spec-speed' into 'master'

Greatly reduce test duration for git_access_spec

See merge request !13675
parent 664b1d36
......@@ -4,6 +4,7 @@ module Gitlab
class GitAccess
UnauthorizedError = Class.new(StandardError)
NotFoundError = Class.new(StandardError)
ProjectMovedError = Class.new(NotFoundError)
ERROR_MESSAGES = {
upload: 'You are not allowed to upload code for this project.',
......@@ -90,7 +91,8 @@ module Gitlab
end
def check_project_moved!
if redirected_path
return unless redirected_path
url = protocol == 'ssh' ? project.ssh_url_to_repo : project.http_url_to_repo
message = <<-MESSAGE.strip_heredoc
Project '#{redirected_path}' was moved to '#{project.full_path}'.
......@@ -100,8 +102,7 @@ module Gitlab
git remote set-url origin #{url}
MESSAGE
raise NotFoundError, message
end
raise ProjectMovedError, message
end
def check_command_disabled!(cmd)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment