Increase commit title limit at Commit#show so it does not truncate most of Merge messages
This commit is contained in:
parent
9711acc9e1
commit
34c97a311c
1 changed files with 6 additions and 6 deletions
|
@ -36,16 +36,16 @@ class Commit
|
||||||
# Returns the commits title.
|
# Returns the commits title.
|
||||||
#
|
#
|
||||||
# Usually, the commit title is the first line of the commit message.
|
# Usually, the commit title is the first line of the commit message.
|
||||||
# In case this first line is longer than 80 characters, it is cut off
|
# In case this first line is longer than 100 characters, it is cut off
|
||||||
# after 70 characters and ellipses (`&hellp;`) are appended.
|
# after 80 characters and ellipses (`&hellp;`) are appended.
|
||||||
def title
|
def title
|
||||||
title = safe_message
|
title = safe_message
|
||||||
|
|
||||||
return no_commit_message if title.blank?
|
return no_commit_message if title.blank?
|
||||||
|
|
||||||
title_end = title.index(/\n/)
|
title_end = title.index(/\n/)
|
||||||
if (!title_end && title.length > 80) || (title_end && title_end > 80)
|
if (!title_end && title.length > 100) || (title_end && title_end > 100)
|
||||||
title[0..69] << "…".html_safe
|
title[0..79] << "…".html_safe
|
||||||
else
|
else
|
||||||
title.split(/\n/, 2).first
|
title.split(/\n/, 2).first
|
||||||
end
|
end
|
||||||
|
@ -58,8 +58,8 @@ class Commit
|
||||||
description = safe_message
|
description = safe_message
|
||||||
|
|
||||||
title_end = description.index(/\n/)
|
title_end = description.index(/\n/)
|
||||||
if (!title_end && description.length > 80) || (title_end && title_end > 80)
|
if (!title_end && description.length > 100) || (title_end && title_end > 100)
|
||||||
"…".html_safe << description[70..-1]
|
"…".html_safe << description[80..-1]
|
||||||
else
|
else
|
||||||
description.split(/\n/, 2)[1].try(:chomp)
|
description.split(/\n/, 2)[1].try(:chomp)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue