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:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-03-05 15:02:36 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-03-28 15:12:08 +0300
commitce69419a60a04b78616e7fe7d26ed7ed936e7c62 (patch)
treecc210e78443643944e46ba11511f8254c9016d22 /lib/gitlab/checks
parent7ea08566f36d97e1cf2b31767ebb122883f4f30e (diff)
Remove permanent redirects
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.
Diffstat (limited to 'lib/gitlab/checks')
-rw-r--r--lib/gitlab/checks/project_moved.rb20
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/gitlab/checks/project_moved.rb b/lib/gitlab/checks/project_moved.rb
index 3263790a876..3a197078d08 100644
--- a/lib/gitlab/checks/project_moved.rb
+++ b/lib/gitlab/checks/project_moved.rb
@@ -9,20 +9,16 @@ module Gitlab
super(project, user, protocol)
end
- def message(rejected: false)
+ def message
<<~MESSAGE
Project '#{redirected_path}' was moved to '#{project.full_path}'.
Please update your Git remote:
- #{remote_url_message(rejected)}
+ git remote set-url origin #{url_to_repo}
MESSAGE
end
- def permanent_redirect?
- RedirectRoute.permanent.exists?(path: redirected_path)
- end
-
private
attr_reader :redirected_path
@@ -30,18 +26,6 @@ module Gitlab
def self.message_key(user_id, project_id)
"#{REDIRECT_NAMESPACE}:#{user_id}:#{project_id}"
end
-
- def remote_url_message(rejected)
- if rejected
- "git remote set-url origin #{url_to_repo} and try again."
- else
- "git remote set-url origin #{url_to_repo}"
- end
- end
-
- def url
- protocol == 'ssh' ? project.ssh_url_to_repo : project.http_url_to_repo
- end
end
end
end