ce69419a60
Removes permanent redirects, this means that redirects will only be possible as long as the old route isn't taken by a new project/group.
31 lines
698 B
Ruby
31 lines
698 B
Ruby
module Gitlab
|
|
module Checks
|
|
class ProjectMoved < PostPushMessage
|
|
REDIRECT_NAMESPACE = "redirect_namespace".freeze
|
|
|
|
def initialize(project, user, protocol, redirected_path)
|
|
@redirected_path = redirected_path
|
|
|
|
super(project, user, protocol)
|
|
end
|
|
|
|
def message
|
|
<<~MESSAGE
|
|
Project '#{redirected_path}' was moved to '#{project.full_path}'.
|
|
|
|
Please update your Git remote:
|
|
|
|
git remote set-url origin #{url_to_repo}
|
|
MESSAGE
|
|
end
|
|
|
|
private
|
|
|
|
attr_reader :redirected_path
|
|
|
|
def self.message_key(user_id, project_id)
|
|
"#{REDIRECT_NAMESPACE}:#{user_id}:#{project_id}"
|
|
end
|
|
end
|
|
end
|
|
end
|