From 5759bfe029b5abb1c3550f702fc5a66da21cfa56 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Tue, 21 Aug 2018 10:53:43 +0100 Subject: Make it clearer when Commit#description returns no_commit_message --- app/models/commit.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'app/models/commit.rb') diff --git a/app/models/commit.rb b/app/models/commit.rb index 09fe9f11dd4..594972ad344 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -193,12 +193,9 @@ class Commit # otherwise returns commit message without first line def description return safe_message if full_title.length >= 100 + return no_commit_message if safe_message.blank? - if safe_message.blank? - no_commit_message - else - safe_message.split("\n", 2)[1].try(:chomp) - end + safe_message.split("\n", 2)[1].try(:chomp) end def description? -- cgit v1.2.3