diff options
Diffstat (limited to 'app/decorators/commit_decorator.rb')
-rw-r--r-- | app/decorators/commit_decorator.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/decorators/commit_decorator.rb b/app/decorators/commit_decorator.rb index 074176ae802..f813ed253d7 100644 --- a/app/decorators/commit_decorator.rb +++ b/app/decorators/commit_decorator.rb @@ -16,6 +16,8 @@ class CommitDecorator < ApplicationDecorator # In case this first line is longer than 80 characters, it is cut off # after 70 characters and ellipses (`&hellp;`) are appended. def title + return no_commit_message unless safe_message + title_end = safe_message.index(/\n/) if (!title_end && safe_message.length > 80) || (title_end && title_end > 80) safe_message[0..69] << "…".html_safe @@ -35,4 +37,10 @@ class CommitDecorator < ApplicationDecorator safe_message.split(/\n/, 2)[1].try(:chomp) end end + + protected + + def no_commit_message + "--no commit message" + end end |