Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-12 23:28:31 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-12 23:28:31 +0400
commit34c97a311c6463bb171a46eaf4a5357aed41964d (patch)
treec760bf89f42427e193acf59b5eba57fbfb80286f /app/models/commit.rb
parent9711acc9e1e24955a28ab09994bbfd9ed538aeb3 (diff)
Increase commit title limit at Commit#show so it does not truncate most of Merge messages
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index e3363350997..da80c2940ff 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -36,16 +36,16 @@ class Commit
# Returns the commits title.
#
# 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
- # after 70 characters and ellipses (`&hellp;`) are appended.
+ # In case this first line is longer than 100 characters, it is cut off
+ # after 80 characters and ellipses (`&hellp;`) are appended.
def title
title = safe_message
return no_commit_message if title.blank?
title_end = title.index(/\n/)
- if (!title_end && title.length > 80) || (title_end && title_end > 80)
- title[0..69] << "&hellip;".html_safe
+ if (!title_end && title.length > 100) || (title_end && title_end > 100)
+ title[0..79] << "&hellip;".html_safe
else
title.split(/\n/, 2).first
end
@@ -58,8 +58,8 @@ class Commit
description = safe_message
title_end = description.index(/\n/)
- if (!title_end && description.length > 80) || (title_end && title_end > 80)
- "&hellip;".html_safe << description[70..-1]
+ if (!title_end && description.length > 100) || (title_end && title_end > 100)
+ "&hellip;".html_safe << description[80..-1]
else
description.split(/\n/, 2)[1].try(:chomp)
end