1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

sync_default_gems.rb: do not add extra empty lines [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2022-10-28 19:04:10 +09:00
parent 4021c6565f
commit 1de8a42869
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -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}"