Skip to content

Commit 61d3d4e

Browse files
author
Daniel Mendler
committed
trim message string
1 parent 8ea488b commit 61d3d4e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/git/lib.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ def process_commit_data(data, sha = nil)
139139
if line == ''
140140
in_message = !in_message
141141
elsif in_message
142-
hsh['message'] << line << "\n"
142+
hsh['message'] << "\n" if hsh['message'] != ''
143+
hsh['message'] << line[4..-1]
143144
else
144145
data = line.split
145146
key = data.shift
@@ -385,10 +386,7 @@ def commit(message, opts = {})
385386
arr_opts = ['-m', message]
386387
arr_opts << '-a' if opts[:add_all]
387388
arr_opts << '--allow-empty' if opts[:allow_empty]
388-
if opts[:author]
389-
arr_opts << "--author"
390-
arr_opts << opts[:author]
391-
end
389+
arr_opts << "--author" << opts[:author] if opts[:author]
392390
command('commit', arr_opts)
393391
end
394392

0 commit comments

Comments
 (0)