summaryrefslogtreecommitdiff
path: root/lib/extracts_path.rb
diff options
context:
space:
mode:
authorwinniehell <git@winniehell.de>2016-08-18 22:48:25 +0200
committerwinniehell <git@winniehell.de>2016-08-19 18:08:08 +0200
commitbb48a0faea00473c24e77e9e7464392f9de2c4fb (patch)
tree6ce34f1c8c3506c2c9a5389fcb188094f54d6c00 /lib/extracts_path.rb
parentf3ee7fc80b10f58d0dbd4ea683e65d5d6ac01666 (diff)
downloadgitlab-ce-bb48a0faea00473c24e77e9e7464392f9de2c4fb.tar.gz
Do not escape URI when extracting path (!5878)
Diffstat (limited to 'lib/extracts_path.rb')
-rw-r--r--lib/extracts_path.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index 84688f6646e..a293fa2752f 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -94,7 +94,9 @@ module ExtractsPath
@options = params.select {|key, value| allowed_options.include?(key) && !value.blank? }
@options = HashWithIndifferentAccess.new(@options)
- @id = Addressable::URI.normalize_component(get_id)
+ @id = params[:id] || params[:ref]
+ @id += "/" + params[:path] unless params[:path].blank?
+
@ref, @path = extract_ref(@id)
@repo = @project.repository
if @options[:extended_sha1].blank?
@@ -116,12 +118,4 @@ module ExtractsPath
def tree
@tree ||= @repo.tree(@commit.id, @path)
end
-
- private
-
- def get_id
- id = params[:id] || params[:ref]
- id += "/" + params[:path] unless params[:path].blank?
- id
- end
end