diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-05-30 18:47:55 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-05-30 18:47:55 +0000 |
commit | 8039b9c3c6caedc19e0e44d086a007e8975134b7 (patch) | |
tree | 859d1a25b2bbb17920315482a8ef4d85369fb936 /app | |
parent | c5e26e57282f8e9423c9281196e4bf317887d68e (diff) | |
parent | 08134ad2909c4497dc5ef0e4b144ccc6330a9de8 (diff) | |
download | gitlab-ce-8039b9c3c6caedc19e0e44d086a007e8975134b7.tar.gz |
Merge branch '30410-revert-9347-and-10079' into 'master'
Resolve "Allow to disable username on checkout url"
Closes #30410 and #30174
See merge request !11792
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/button_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 6 | ||||
-rw-r--r-- | app/models/project_wiki.rb | 7 |
4 files changed, 6 insertions, 11 deletions
diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb index 206d0753f08..0081bbd92b3 100644 --- a/app/helpers/button_helper.rb +++ b/app/helpers/button_helper.rb @@ -56,7 +56,7 @@ module ButtonHelper content_tag (append_link ? :a : :span), protocol, class: klass, - href: (project.http_url_to_repo(current_user) if append_link), + href: (project.http_url_to_repo if append_link), data: { html: true, placement: placement, diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 654aa1a6533..7b0584c42a2 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -276,7 +276,7 @@ module ProjectsHelper when 'ssh' project.ssh_url_to_repo else - project.http_url_to_repo(current_user) + project.http_url_to_repo end end diff --git a/app/models/project.rb b/app/models/project.rb index 84070290743..a59095cb25c 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -874,10 +874,8 @@ class Project < ActiveRecord::Base url_to_repo end - def http_url_to_repo(user = nil) - credentials = Gitlab::UrlSanitizer.http_credentials_for_user(user) - - Gitlab::UrlSanitizer.new("#{web_url}.git", credentials: credentials).full_url + def http_url_to_repo + "#{web_url}.git" end def user_can_push_to_empty_repo?(user) diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index 189c106b70b..f38fbda7839 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -42,11 +42,8 @@ class ProjectWiki url_to_repo end - def http_url_to_repo(user = nil) - url = "#{Gitlab.config.gitlab.url}/#{path_with_namespace}.git" - credentials = Gitlab::UrlSanitizer.http_credentials_for_user(user) - - Gitlab::UrlSanitizer.new(url, credentials: credentials).full_url + def http_url_to_repo + "#{Gitlab.config.gitlab.url}/#{path_with_namespace}.git" end def wiki_base_path |