summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLUKE BENNETT <lbennett@gitlab.com>2018-01-17 00:16:02 +0000
committerLUKE BENNETT <lbennett@gitlab.com>2018-01-17 00:16:02 +0000
commit3cf7681af325ba4865312d959fb4a6cb8fc449db (patch)
tree67f8d430e4c1e11b5f01c5d5c3b5ab3291c97783 /lib
parent904b1cda82ab7b2c5beb01e589a4607af7f7e519 (diff)
parent09b07d8420e1102ac3fcfef1395f70439dcc6c76 (diff)
downloadgitlab-ce-3cf7681af325ba4865312d959fb4a6cb8fc449db.tar.gz
Merge branch '10-4-stable-prepare-rc6' into '10-4-stable'10-4-stable-with-rc5-and-rc6
10.4.0-rc6 on rc5 sec release See merge request gitlab/gitlabhq!2310
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers/common_helpers.rb6
-rw-r--r--lib/banzai/filter/relative_link_filter.rb15
-rw-r--r--lib/gitlab/auth/user_auth_finders.rb4
-rw-r--r--lib/gitlab/bare_repository_import/importer.rb1
4 files changed, 17 insertions, 9 deletions
diff --git a/lib/api/helpers/common_helpers.rb b/lib/api/helpers/common_helpers.rb
index 322624c6092..9993caa5249 100644
--- a/lib/api/helpers/common_helpers.rb
+++ b/lib/api/helpers/common_helpers.rb
@@ -3,8 +3,10 @@ module API
module CommonHelpers
def convert_parameters_from_legacy_format(params)
params.tap do |params|
- if params[:assignee_id].present?
- params[:assignee_ids] = [params.delete(:assignee_id)]
+ assignee_id = params.delete(:assignee_id)
+
+ if assignee_id.present?
+ params[:assignee_ids] = [assignee_id]
end
end
end
diff --git a/lib/banzai/filter/relative_link_filter.rb b/lib/banzai/filter/relative_link_filter.rb
index 5c197afd782..f6169b2c85d 100644
--- a/lib/banzai/filter/relative_link_filter.rb
+++ b/lib/banzai/filter/relative_link_filter.rb
@@ -50,15 +50,22 @@ module Banzai
end
def process_link_to_upload_attr(html_attr)
- uri_parts = [html_attr.value]
+ path_parts = [html_attr.value]
if group
- uri_parts.unshift(relative_url_root, 'groups', group.full_path, '-')
+ path_parts.unshift(relative_url_root, 'groups', group.full_path, '-')
elsif project
- uri_parts.unshift(relative_url_root, project.full_path)
+ path_parts.unshift(relative_url_root, project.full_path)
end
- html_attr.value = File.join(*uri_parts)
+ path = File.join(*path_parts)
+
+ html_attr.value =
+ if context[:only_path]
+ path
+ else
+ URI.join(Gitlab.config.gitlab.base_url, path).to_s
+ end
end
def process_link_to_repository_attr(html_attr)
diff --git a/lib/gitlab/auth/user_auth_finders.rb b/lib/gitlab/auth/user_auth_finders.rb
index b4114a3ac96..cf02030c577 100644
--- a/lib/gitlab/auth/user_auth_finders.rb
+++ b/lib/gitlab/auth/user_auth_finders.rb
@@ -96,9 +96,7 @@ module Gitlab
end
def ensure_action_dispatch_request(request)
- return request if request.is_a?(ActionDispatch::Request)
-
- ActionDispatch::Request.new(request.env)
+ ActionDispatch::Request.new(request.env.dup)
end
def current_request
diff --git a/lib/gitlab/bare_repository_import/importer.rb b/lib/gitlab/bare_repository_import/importer.rb
index 709a901aa77..884a3de8f62 100644
--- a/lib/gitlab/bare_repository_import/importer.rb
+++ b/lib/gitlab/bare_repository_import/importer.rb
@@ -63,6 +63,7 @@ module Gitlab
log " * Created #{project.name} (#{project_full_path})".color(:green)
project.write_repository_config
+ project.repository.create_hooks
ProjectCacheWorker.perform_async(project.id)
else