Unverified Commit d60d5fe4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Improve ExtractsPath logic related to atom format



* Don't set request format to atom if '.atom' suffix was not provided
* Don't try '.atom' detection logic on request that uses extended_sha1
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 5e9a3944
......@@ -113,17 +113,18 @@ def assign_ref_vars
@id = get_id
@ref, @path = extract_ref(@id)
@repo = @project.repository
if @options[:extended_sha1].blank?
@commit = @repo.commit(@ref)
else
@commit = @repo.commit(@options[:extended_sha1])
end
if @path.empty? && !@commit
@id = @ref = extract_ref_without_atom(@id)
if @options[:extended_sha1].present?
@commit = @repo.commit(@options[:extended_sha1])
else
@commit = @repo.commit(@ref)
request.format = :atom if @commit
if @path.empty? && !@commit && @id.ends_with?('.atom')
@id = @ref = extract_ref_without_atom(@id)
@commit = @repo.commit(@ref)
request.format = :atom if @commit
end
end
raise InvalidPathError unless @commit
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment