diff options
Diffstat (limited to 'tool/sync_default_gems.rb')
-rwxr-xr-x | tool/sync_default_gems.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index d6b20a82bf..80eabab81c 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -441,9 +441,10 @@ def message_filter(repo, sha, input: ARGF) end url = "#{url}/commit/#{sha[0,10]}\n" if log and !log.empty? + log.sub!(/(?<=\n)\n+\z/, '') # drop empty lines at the last conv[log] - log.sub!(/\s*(?=(?i:\nCo-authored-by:.*)*\Z)/) { - "\n\n#{url}" + log.sub!(/(?:(\A\s*)|\s*\n)(?=(?i:Co-authored-by:.*)*\Z)/) { + $~.begin(0) ? "#{url}\n" : "\n\n#{url}" } else log = url |