summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-09-11 00:08:51 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-09-11 00:08:51 -0700
commit1c08cb404d5e874ae7d79a540e493bbf1f0d3061 (patch)
treeb56ae9a6f0d5abe4da3f0fb45f4efff3b97622ec
parenta2f7f48c034bc32fe626980ed88f8789b19b36bd (diff)
parent7e2846fb57ef24dfac0de57f7b086a7415cc44e7 (diff)
downloadgitlab-ce-1c08cb404d5e874ae7d79a540e493bbf1f0d3061.tar.gz
Merge pull request #1424 from elvanja/issue-1343-empty-string-fix
FIX: Empty string in commit message
-rw-r--r--app/decorators/commit_decorator.rb2
-rw-r--r--app/helpers/gitlab_markdown_helper.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/app/decorators/commit_decorator.rb b/app/decorators/commit_decorator.rb
index f813ed253d7..c85f740027e 100644
--- a/app/decorators/commit_decorator.rb
+++ b/app/decorators/commit_decorator.rb
@@ -16,7 +16,7 @@ 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
+ return no_commit_message if safe_message.blank?
title_end = safe_message.index(/\n/)
if (!title_end && safe_message.length > 80) || (title_end && title_end > 80)
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index e97e46f5b66..511d4628e12 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -11,6 +11,8 @@ module GitlabMarkdownHelper
# explicitly produce the correct linking behavior (i.e.
# "<a>outer text </a><a>gfm ref</a><a> more outer text</a>").
def link_to_gfm(body, url, html_options = {})
+ return "" if body.blank?
+
gfm_body = gfm(body, html_options)
gfm_body.gsub!(%r{<a.*?>.*?</a>}m) do |match|