MR branch link now links to tree instead of commits
This commit is contained in:
parent
31ada79262
commit
9e4e1afb4a
|
@ -94,7 +94,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
|
||||||
|
|
||||||
if source_branch_exists?
|
if source_branch_exists?
|
||||||
namespace = link_to(namespace, project_path(source_project))
|
namespace = link_to(namespace, project_path(source_project))
|
||||||
branch = link_to(branch, project_commits_path(source_project, source_branch))
|
branch = link_to(branch, project_tree_path(source_project, source_branch))
|
||||||
end
|
end
|
||||||
|
|
||||||
if for_fork?
|
if for_fork?
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: MR branch link now links to tree instead of commits
|
||||||
|
merge_request:
|
||||||
|
author:
|
|
@ -363,4 +363,17 @@ describe MergeRequestPresenter do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#source_branch_with_namespace_link' do
|
||||||
|
subject do
|
||||||
|
described_class.new(resource, current_user: user).source_branch_with_namespace_link
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'returns link' do
|
||||||
|
allow(resource).to receive(:source_branch_exists?) { true }
|
||||||
|
|
||||||
|
is_expected
|
||||||
|
.to eq("<a href=\"/#{resource.source_project.full_path}/tree/#{resource.source_branch}\">#{resource.source_branch}</a>")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue