diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-10-28 19:04:10 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-10-28 19:04:53 +0900 |
commit | 1de8a4286950b554093e4fea4ace85a312a7fce8 (patch) | |
tree | 023307485d0557eaea4b7e3e34388a3009761c4f /tool | |
parent | 4021c6565f9655bfd667152f76f22f7cc81c7e17 (diff) |
sync_default_gems.rb: do not add extra empty lines [ci skip]
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/sync_default_gems.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index b669be7f55..7543b4f73c 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -422,7 +422,7 @@ def message_filter(repo, sha) log = STDIN.read log.delete!("\r") url = "https://github.com/#{repo}" - subject, log = log.split("\n\n", 2) + subject, log = log.split(/\n(?:[\s\t]*(?:\n|\z))/, 2) conv = proc do |s| mod = true if s.gsub!(/\b(?:(?i:fix(?:e[sd])?) +)\K#(?=\d+\b)|\bGH-#?(?=\d+\b)|\(\K#(?=\d+\))/) { "#{url}/pull/" @@ -440,7 +440,7 @@ def message_filter(repo, sha) end end url = "#{url}/commit/#{sha[0,10]}\n" - if log + if log and !log.empty? conv[log] log.sub!(/\s*(?=(?i:\nCo-authored-by:.*)*\Z)/) { "\n\n#{url}" |