From 1101ceb3f4dfb8983f5876215378331a2d9bcc88 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Wed, 21 Aug 2013 19:20:29 +0900 Subject: A little improvement 1. Replace params key 'q' with 'extended_sha1'. A extended SHA1 syntax is explained in 'man gitrevisions'. 2. Change the placeholder of looking for commit. 3. Change the label of ref filter. --- lib/extracts_path.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/extracts_path.rb') diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb index f9843d503b4..53bc079296a 100644 --- a/lib/extracts_path.rb +++ b/lib/extracts_path.rb @@ -95,17 +95,17 @@ module ExtractsPath # resolved (e.g., when a user inserts an invalid path or ref). def assign_ref_vars # assign allowed options - allowed_options = ["filter_ref", "q"] + allowed_options = ["filter_ref", "extended_sha1"] @options = params.select {|key, value| allowed_options.include?(key) && !value.blank? } @options = HashWithIndifferentAccess.new(@options) @id = get_id @ref, @path = extract_ref(@id) @repo = @project.repository - if @options[:q].blank? + if @options[:extended_sha1].blank? @commit = @repo.commit(@ref) else - @commit = @repo.commit(@options[:q]) + @commit = @repo.commit(@options[:extended_sha1]) end @tree = Tree.new(@repo, @commit.id, @ref, @path) @hex_path = Digest::SHA1.hexdigest(@path) -- cgit v1.2.3