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:
authorSean McGivern <sean@gitlab.com>2018-08-21 12:53:43 +0300
committerSean McGivern <sean@gitlab.com>2018-08-21 13:41:25 +0300
commit5759bfe029b5abb1c3550f702fc5a66da21cfa56 (patch)
tree3a18d630e8eca69139d5e009547193d50944954b /app/models/commit.rb
parente3f13c9e0a121ef8ed9d60f7239f70d3d0e7815f (diff)
Make it clearer when Commit#description returns no_commit_message
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb7
1 files changed, 2 insertions, 5 deletions
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?