From 9e822ca4920dcc95fa52fadecfe04c31870a7c02 Mon Sep 17 00:00:00 2001 From: rkiel Date: Sun, 7 Jun 2015 20:22:30 -0400 Subject: [PATCH] adding-help: commit prevent the use of semicolon --- lib/feature/commit.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/feature/commit.rb b/lib/feature/commit.rb index 7e96f39..fbc964d 100644 --- a/lib/feature/commit.rb +++ b/lib/feature/commit.rb @@ -18,9 +18,14 @@ module Feature parts = parse_branch(current_branch) comment = argv.reject { |x| x == '-m' }.join(' ') - comment = "#{parts[:feature]}: #{comment}" + if comment.include? ";" + error "invalid character: ';'" + else + comment = "#{parts[:feature]}: #{comment}" + git_commit comment + end + - git_commit comment end end