Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
9e4e1afb
Commit
9e4e1afb
authored
Jul 10, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MR branch link now links to tree instead of commits
parent
31ada792
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
app/presenters/merge_request_presenter.rb
app/presenters/merge_request_presenter.rb
+1
-1
changelogs/unreleased/mr-branch-link-use-tree.yml
changelogs/unreleased/mr-branch-link-use-tree.yml
+4
-0
spec/presenters/merge_request_presenter_spec.rb
spec/presenters/merge_request_presenter_spec.rb
+13
-0
No files found.
app/presenters/merge_request_presenter.rb
View file @
9e4e1afb
...
...
@@ -94,7 +94,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
if
source_branch_exists?
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
if
for_fork?
...
...
changelogs/unreleased/mr-branch-link-use-tree.yml
0 → 100644
View file @
9e4e1afb
---
title
:
MR branch link now links to tree instead of commits
merge_request
:
author
:
spec/presenters/merge_request_presenter_spec.rb
View file @
9e4e1afb
...
...
@@ -363,4 +363,17 @@ describe MergeRequestPresenter do
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment