diff options
author | Hiroyuki Sato <sathiroyuki@gmail.com> | 2013-08-21 19:20:29 +0900 |
---|---|---|
committer | Hiroyuki Sato <sathiroyuki@gmail.com> | 2013-08-21 19:20:29 +0900 |
commit | 1101ceb3f4dfb8983f5876215378331a2d9bcc88 (patch) | |
tree | b307e3ffde36f149bcbfcc033390ad7e09485c6e /lib/extracts_path.rb | |
parent | 5f24bdb7d067df9204e08e126f43c071116089b0 (diff) | |
download | gitlab-ce-1101ceb3f4dfb8983f5876215378331a2d9bcc88.tar.gz |
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.
Diffstat (limited to 'lib/extracts_path.rb')
-rw-r--r-- | lib/extracts_path.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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) |