diff options
author | Valery Sizov <valery@gitlab.com> | 2017-09-20 19:57:13 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2017-09-20 19:57:13 +0300 |
commit | ce2f10b07eab3733e45a359e4705ddcc2a7316bd (patch) | |
tree | 7c9a1d477ef4330c6390c042c7087acb09594ed9 /lib/extracts_path.rb | |
parent | 59e827db3bd497844e82911cb6c6d899453029f9 (diff) | |
download | gitlab-ce-rails5-middle.tar.gz |
Fix spec/controllers/projects/commits_controller_spec.rbrails5-middle
If branch contains '.atom' suffix we should be able to show the link via html protocol
Diffstat (limited to 'lib/extracts_path.rb')
-rw-r--r-- | lib/extracts_path.rb | 13 |
1 files 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 |