Commit 74a81cbf authored by Douwe Maan's avatar Douwe Maan

Fix branch rendering

parent 05c9d882
...@@ -56,12 +56,14 @@ module MergeRequestsHelper ...@@ -56,12 +56,14 @@ module MergeRequestsHelper
end end
def source_branch_with_namespace(merge_request) def source_branch_with_namespace(merge_request)
branch = link_to(merge_request.source_branch, namespace_project_commits_path(merge_request.source_project.namespace, merge_request.source_project, merge_request.source_branch))
if merge_request.for_fork? if merge_request.for_fork?
namespace = link_to(merge_request.source_project_namespace, namespace = link_to(merge_request.source_project_namespace,
project_path(merge_request.source_project)) project_path(merge_request.source_project))
namespace + ":#{merge_request.source_branch}" namespace + ":" + branch
else else
merge_request.source_branch branch
end end
end end
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
%li= link_to "Plain Diff", merge_request_path(@merge_request, format: :diff) %li= link_to "Plain Diff", merge_request_path(@merge_request, format: :diff)
.normal .normal
%span Request to merge %span Request to merge
= link_to source_branch_with_namespace(@merge_request), namespace_project_commits_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), class: "label-branch" %span.label-branch
= source_branch_with_namespace(@merge_request)
%span into %span into
= link_to namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch" do = link_to namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch" do
= @merge_request.target_branch = @merge_request.target_branch
......
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