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
path: root/lib
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2016-11-22 19:57:12 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2016-11-22 19:57:12 +0300
commita713c9c12c919b2b9caec4fe6cf3ac64ff2746f2 (patch)
treef89fb349e75d8bd11e4270b0b3649a4ba4a57c8c /lib
parentdfb21e299ff999f5e65e092fdab8b9e9c0e5ac73 (diff)
parent3ff0575669ecda15c5e72bd2987715a998f97d82 (diff)
Merge branch 'zj-fix-trailing-whitespace-issue-create' into 'master'
Issue creation now accepts trailing whitespace See merge request !7633
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/chat_commands/issue_create.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/chat_commands/issue_create.rb b/lib/gitlab/chat_commands/issue_create.rb
index 98338ebfa27..99c1382af44 100644
--- a/lib/gitlab/chat_commands/issue_create.rb
+++ b/lib/gitlab/chat_commands/issue_create.rb
@@ -2,7 +2,9 @@ module Gitlab
module ChatCommands
class IssueCreate < IssueCommand
def self.match(text)
- /\Aissue\s+create\s+(?<title>[^\n]*)\n*(?<description>.*)\z/.match(text)
+ # we can not match \n with the dot by passing the m modifier as than
+ # the title and description are not seperated
+ /\Aissue\s+create\s+(?<title>[^\n]*)\n*(?<description>(.|\n)*)/.match(text)
end
def self.help_message
@@ -15,7 +17,7 @@ module Gitlab
def execute(match)
title = match[:title]
- description = match[:description]
+ description = match[:description].to_s.rstrip
Issues::CreateService.new(project, current_user, title: title, description: description).execute
end