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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
a91101d0
Commit
a91101d0
authored
Sep 11, 2017
by
micael.bergeron
Committed by
GitLab Development
Sep 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rework the html_safe not to use haml's auto escaping
add feature test for inline diff in file header
parent
d70c3bbc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
app/views/projects/diffs/_file_header.html.haml
app/views/projects/diffs/_file_header.html.haml
+3
-3
changelogs/unreleased/37576-renamed-files-have-escaped-html-for-the-inline-diff-in-the-header.yml
...s-have-escaped-html-for-the-inline-diff-in-the-header.yml
+5
-0
spec/features/projects/diffs/diff_show_spec.rb
spec/features/projects/diffs/diff_show_spec.rb
+13
-0
No files found.
app/views/projects/diffs/_file_header.html.haml
View file @
a91101d0
...
@@ -17,12 +17,12 @@
...
@@ -17,12 +17,12 @@
=
blob_icon
diff_file
.
b_mode
,
diff_file
.
file_path
=
blob_icon
diff_file
.
b_mode
,
diff_file
.
file_path
-
if
diff_file
.
renamed_file?
-
if
diff_file
.
renamed_file?
-
old_path
,
new_path
=
mark_inline_diffs
(
diff_file
.
old_path
,
diff_file
.
new_path
)
-
old_path
,
new_path
=
mark_inline_diffs
(
diff_file
.
old_path
,
diff_file
.
new_path
)
.
map
(
&
:html_safe
)
%strong
.file-title-name.has-tooltip
{
data:
{
title:
diff_file
.
old_path
,
container:
'body'
}
}
%strong
.file-title-name.has-tooltip
{
data:
{
title:
diff_file
.
old_path
,
container:
'body'
}
}
!
=
old_path
=
old_path
→
→
%strong
.file-title-name.has-tooltip
{
data:
{
title:
diff_file
.
new_path
,
container:
'body'
}
}
%strong
.file-title-name.has-tooltip
{
data:
{
title:
diff_file
.
new_path
,
container:
'body'
}
}
!
=
new_path
=
new_path
-
else
-
else
%strong
.file-title-name.has-tooltip
{
data:
{
title:
diff_file
.
file_path
,
container:
'body'
}
}
%strong
.file-title-name.has-tooltip
{
data:
{
title:
diff_file
.
file_path
,
container:
'body'
}
}
=
diff_file
.
file_path
=
diff_file
.
file_path
...
...
changelogs/unreleased/37576-renamed-files-have-escaped-html-for-the-inline-diff-in-the-header.yml
0 → 100644
View file @
a91101d0
---
title
:
Fix the diff file header from being html escaped for renamed files.
merge_request
:
14121
author
:
type
:
fixed
spec/features/projects/diffs/diff_show_spec.rb
View file @
a91101d0
...
@@ -108,6 +108,19 @@ feature 'Diff file viewer', :js do
...
@@ -108,6 +108,19 @@ feature 'Diff file viewer', :js do
end
end
end
end
context
'renamed file'
do
before
do
visit_commit
(
'6907208d755b60ebeacb2e9dfea74c92c3449a1f'
)
end
it
'shows the filename with diff highlight'
do
within
(
'.file-header-content'
)
do
expect
(
page
).
to
have_css
(
'.idiff.left.right.deletion'
)
expect
(
page
).
to
have_content
(
'files/js/commit.coffee'
)
end
end
end
context
'binary file that appears to be text in the first 1024 bytes'
do
context
'binary file that appears to be text in the first 1024 bytes'
do
before
do
before
do
# The file we're visiting is smaller than 10 KB and we want it collapsed
# The file we're visiting is smaller than 10 KB and we want it collapsed
...
...
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