summaryrefslogtreecommitdiff
path: root/lib/extracts_path.rb
diff options
context:
space:
mode:
authorSato Hiroyuki <sathiroyuki@gmail.com>2013-04-14 12:09:47 +0000
committerSato Hiroyuki <sathiroyuki@gmail.com>2013-05-13 18:44:33 +0900
commitc0e3b39792cb7ad479af66c07685eb37e654ccb6 (patch)
treec574680995d385213205c63e8f8e6fb44e38b574 /lib/extracts_path.rb
parent97a9c2293affaeeba6f448b8760bb5dffd170f2c (diff)
downloadgitlab-ce-c0e3b39792cb7ad479af66c07685eb37e654ccb6.tar.gz
Set @options in assing_ref_vars
@options enable to keep params when switching ref.
Diffstat (limited to 'lib/extracts_path.rb')
-rw-r--r--lib/extracts_path.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index 6025bb2a9f6..a81c80cfc6f 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -106,6 +106,11 @@ module ExtractsPath
@hex_path = Digest::SHA1.hexdigest(@path)
@logs_path = logs_file_project_ref_path(@project, @ref, @path)
+ # assign allowed options
+ allowed_options = ["filter_ref", "q"]
+ @options = params.select {|key, value| allowed_options.include?(key) && !value.blank? }
+ @options = HashWithIndifferentAccess.new(@options)
+
raise InvalidPathError unless @tree.exists?
rescue RuntimeError, NoMethodError, InvalidPathError
not_found!