зеркало из https://github.com/github/ruby.git
sync_default_gems.rb: fix the position to insert the original URL
Since the regexp had expected an empty line before `Co-Authored-By:` trailer lines, it failed to match when the body has the trailer only.
This commit is contained in:
Родитель
570dee15a6
Коммит
b6d7e98f25
|
@ -441,9 +441,10 @@ def message_filter(repo, sha, input: ARGF)
|
||||||
end
|
end
|
||||||
url = "#{url}/commit/#{sha[0,10]}\n"
|
url = "#{url}/commit/#{sha[0,10]}\n"
|
||||||
if log and !log.empty?
|
if log and !log.empty?
|
||||||
|
log.sub!(/(?<=\n)\n+\z/, '') # drop empty lines at the last
|
||||||
conv[log]
|
conv[log]
|
||||||
log.sub!(/\s*(?=(?i:\nCo-authored-by:.*)*\Z)/) {
|
log.sub!(/(?:(\A\s*)|\s*\n)(?=(?i:Co-authored-by:.*)*\Z)/) {
|
||||||
"\n\n#{url}"
|
$~.begin(0) ? "#{url}\n" : "\n\n#{url}"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log = url
|
log = url
|
||||||
|
|
Загрузка…
Ссылка в новой задаче