Commit 34c97a311c6463bb171a46eaf4a5357aed41964d

Authored by Dmitriy Zaporozhets
1 parent 9711acc9

Increase commit title limit at Commit#show so it does not truncate most of Merge messages

Showing 1 changed file with 6 additions and 6 deletions   Show diff stats
app/models/commit.rb
@@ -36,16 +36,16 @@ class Commit @@ -36,16 +36,16 @@ class Commit
36 # Returns the commits title. 36 # Returns the commits title.
37 # 37 #
38 # Usually, the commit title is the first line of the commit message. 38 # Usually, the commit title is the first line of the commit message.
39 - # In case this first line is longer than 80 characters, it is cut off  
40 - # after 70 characters and ellipses (`&hellp;`) are appended. 39 + # In case this first line is longer than 100 characters, it is cut off
  40 + # after 80 characters and ellipses (`&hellp;`) are appended.
41 def title 41 def title
42 title = safe_message 42 title = safe_message
43 43
44 return no_commit_message if title.blank? 44 return no_commit_message if title.blank?
45 45
46 title_end = title.index(/\n/) 46 title_end = title.index(/\n/)
47 - if (!title_end && title.length > 80) || (title_end && title_end > 80)  
48 - title[0..69] << "&hellip;".html_safe 47 + if (!title_end && title.length > 100) || (title_end && title_end > 100)
  48 + title[0..79] << "&hellip;".html_safe
49 else 49 else
50 title.split(/\n/, 2).first 50 title.split(/\n/, 2).first
51 end 51 end
@@ -58,8 +58,8 @@ class Commit @@ -58,8 +58,8 @@ class Commit
58 description = safe_message 58 description = safe_message
59 59
60 title_end = description.index(/\n/) 60 title_end = description.index(/\n/)
61 - if (!title_end && description.length > 80) || (title_end && title_end > 80)  
62 - "&hellip;".html_safe << description[70..-1] 61 + if (!title_end && description.length > 100) || (title_end && title_end > 100)
  62 + "&hellip;".html_safe << description[80..-1]
63 else 63 else
64 description.split(/\n/, 2)[1].try(:chomp) 64 description.split(/\n/, 2)[1].try(:chomp)
65 end 65 end