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
Kazuhiko Shiozaki
gitlab-ce
Commits
5662b241
Commit
5662b241
authored
Apr 14, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use HTML ellipsis in EmailsOnPush subject truncated commit message.
parent
bf7932bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
CHANGELOG
CHANGELOG
+1
-0
app/models/commit.rb
app/models/commit.rb
+2
-2
spec/models/commit_spec.rb
spec/models/commit_spec.rb
+1
-1
No files found.
CHANGELOG
View file @
5662b241
Please view this file on the master branch, on stable branches it's out of date.
v 7.10.0 (unreleased)
- Don't use HTML ellipsis in EmailsOnPush subject truncated commit message.
- Fix broken file browsing with a submodule that contains a relative link (Stan Hu)
- Fix persistent XSS vulnerability around profile website URLs.
- Fix project import URL regex to prevent arbitary local repos from being imported.
...
...
app/models/commit.rb
View file @
5662b241
...
...
@@ -77,7 +77,7 @@ class Commit
title_end
=
title
.
index
(
"
\n
"
)
if
(
!
title_end
&&
title
.
length
>
100
)
||
(
title_end
&&
title_end
>
100
)
title
[
0
..
79
]
<<
"
…"
.
html_safe
title
[
0
..
79
]
<<
"
…"
else
title
.
split
(
"
\n
"
,
2
).
first
end
...
...
@@ -90,7 +90,7 @@ class Commit
title_end
=
safe_message
.
index
(
"
\n
"
)
@description
||=
if
(
!
title_end
&&
safe_message
.
length
>
100
)
||
(
title_end
&&
title_end
>
100
)
"
…"
.
html_safe
<<
safe_message
[
80
..-
1
]
"
…"
<<
safe_message
[
80
..-
1
]
else
safe_message
.
split
(
"
\n
"
,
2
)[
1
].
try
(
:chomp
)
end
...
...
spec/models/commit_spec.rb
View file @
5662b241
...
...
@@ -14,7 +14,7 @@ describe Commit do
message
=
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit. Vivamus egestas lacinia lacus, sed rutrum mauris.'
allow
(
commit
).
to
receive
(
:safe_message
).
and_return
(
message
)
expect
(
commit
.
title
).
to
eq
(
"
#{
message
[
0
..
79
]
}
…
"
)
expect
(
commit
.
title
).
to
eq
(
"
#{
message
[
0
..
79
]
}
…
"
)
end
it
"truncates a message with a newline before 80 characters at the newline"
do
...
...
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