mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Fix the case of multiple trailers
This commit is contained in:
parent
5a171ee4c0
commit
93e87c0217
Notes:
git
2022-11-28 07:30:58 +00:00
2 changed files with 13 additions and 2 deletions
|
@ -450,8 +450,8 @@ def message_filter(repo, sha, input: ARGF)
|
||||||
if log and !log.empty?
|
if log and !log.empty?
|
||||||
log.sub!(/(?<=\n)\n+\z/, '') # drop empty lines at the last
|
log.sub!(/(?<=\n)\n+\z/, '') # drop empty lines at the last
|
||||||
conv[log]
|
conv[log]
|
||||||
log.sub!(/(?:(\A\s*)|\s*\n)(?=(?i:Co-authored-by:.*)*\Z)/) {
|
log.sub!(/(?:(\A\s*)|\s*\n)(?=((?i:Co-authored-by:.*\n)+)?\Z)/) {
|
||||||
$~.begin(1) ? "#{commit_url}\n" : "\n\n#{commit_url}"
|
($~.begin(1) ? "" : "\n\n") + commit_url + ($~.begin(2) ? "\n" : "")
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log = commit_url
|
log = commit_url
|
||||||
|
|
|
@ -51,5 +51,16 @@ module Test_SyncDefaultGems
|
||||||
]
|
]
|
||||||
assert_message_filter(expected, trailers, [expected, "", trailers, ""].join("\n"))
|
assert_message_filter(expected, trailers, [expected, "", trailers, ""].join("\n"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_multiple_co_authored_by
|
||||||
|
expected = [
|
||||||
|
"many commits",
|
||||||
|
]
|
||||||
|
trailers = [
|
||||||
|
"Co-authored-by: git <git@ruby-lang.org>",
|
||||||
|
"Co-authored-by: svn <svn@ruby-lang.org>",
|
||||||
|
]
|
||||||
|
assert_message_filter(expected, trailers, [expected, "", trailers, ""].join("\n"))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue