Commit d60d5fe4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

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,18 +113,19 @@ module ExtractsPath ...@@ -113,18 +113,19 @@ module ExtractsPath
@id = get_id @id = get_id
@ref, @path = extract_ref(@id) @ref, @path = extract_ref(@id)
@repo = @project.repository @repo = @project.repository
if @options[:extended_sha1].blank?
@commit = @repo.commit(@ref) if @options[:extended_sha1].present?
else
@commit = @repo.commit(@options[:extended_sha1]) @commit = @repo.commit(@options[:extended_sha1])
end else
@commit = @repo.commit(@ref)
if @path.empty? && !@commit if @path.empty? && !@commit && @id.ends_with?('.atom')
@id = @ref = extract_ref_without_atom(@id) @id = @ref = extract_ref_without_atom(@id)
@commit = @repo.commit(@ref) @commit = @repo.commit(@ref)
request.format = :atom if @commit request.format = :atom if @commit
end end
end
raise InvalidPathError unless @commit 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