summaryrefslogtreecommitdiff
path: root/lib/extracts_path.rb
diff options
context:
space:
mode:
authorHiroyuki Sato <h-sato@ruby-dev.jp>2016-11-06 12:33:39 +0900
committerHiroyuki Sato <h-sato@ruby-dev.jp>2016-11-06 12:33:39 +0900
commitd8cc8d7adc4c50843ecacc77a30b2e6db4e3fd84 (patch)
tree2cd5a166ecbbefb83df02133391f54caff029664 /lib/extracts_path.rb
parentd02f7d29c07632f219e103ba256636f49329067c (diff)
downloadgitlab-ce-d8cc8d7adc4c50843ecacc77a30b2e6db4e3fd84.tar.gz
Remove 'extended_sha1' option from ExtractsPath module
Diffstat (limited to 'lib/extracts_path.rb')
-rw-r--r--lib/extracts_path.rb20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index a8cc189a8c2..82551f1f222 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -106,7 +106,7 @@ 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", "extended_sha1"]
+ allowed_options = ["filter_ref"]
@options = params.select {|key, value| allowed_options.include?(key) && !value.blank? }
@options = HashWithIndifferentAccess.new(@options)
@@ -114,21 +114,17 @@ module ExtractsPath
@ref, @path = extract_ref(@id)
@repo = @project.repository
- if @options[:extended_sha1].present?
- @commit = @repo.commit(@options[:extended_sha1])
- else
- @commit = @repo.commit(@ref)
-
- if @path.empty? && !@commit && @id.ends_with?('.atom')
- @id = @ref = extract_ref_without_atom(@id)
- @commit = @repo.commit(@ref)
+ @commit = @repo.commit(@ref)
- request.format = :atom if @commit
- end
+ if @path.empty? && !@commit && @id.ends_with?('.atom')
+ @id = @ref = extract_ref_without_atom(@id)
+ @commit = @repo.commit(@ref)
- raise InvalidPathError unless @commit
+ request.format = :atom if @commit
end
+ raise InvalidPathError unless @commit
+
@hex_path = Digest::SHA1.hexdigest(@path)
@logs_path = logs_file_namespace_project_ref_path(@project.namespace,
@project, @ref, @path)