提交 8ef91a0a 编写于 作者: D Dmitriy Zaporozhets

Merge branch 'dz-fix-extract-path' into 'master'

Improve ExtractsPath logic related to atom format

* Fixes one test from https://gitlab.com/gitlab-org/gitlab-ce/issues/23378. 
* Fixes issue introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6750.

See merge request !6907
......@@ -113,17 +113,18 @@ module ExtractsPath
@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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册