blob: 4cc35de9c2d6ebf345241ea24789d9657e3d0de5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# frozen_string_literal: true
module Gitlab
module Checks
class ProjectMoved < PostPushMessage
REDIRECT_NAMESPACE = "redirect_namespace"
def initialize(repository, user, protocol, redirected_path)
@redirected_path = redirected_path
super(repository, 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
|