From ce2f10b07eab3733e45a359e4705ddcc2a7316bd Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Wed, 20 Sep 2017 19:57:13 +0300 Subject: Fix spec/controllers/projects/commits_controller_spec.rb If branch contains '.atom' suffix we should be able to show the link via html protocol --- lib/extracts_path.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb index 721ed97bb6b..fe4c619e4d4 100644 --- a/lib/extracts_path.rb +++ b/lib/extracts_path.rb @@ -116,11 +116,14 @@ module ExtractsPath @commit = @repo.commit(@ref) - if @path.empty? && !@commit && @id.ends_with?('.atom') - @id = @ref = extract_ref_without_atom(@id) - @commit = @repo.commit(@ref) - - request.format = :atom if @commit + if @path.empty? && @id.ends_with?('.atom') + if @commit + request.format = :html + else + @id = @ref = extract_ref_without_atom(@id) + @commit = @repo.commit(@ref) + request.format = :atom if @commit + end end raise InvalidPathError unless @commit -- cgit v1.2.1